9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] code complexity
@ 2002-02-05 16:34 Russ Cox
  2002-02-05 16:39 ` Boyd Roberts
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Russ Cox @ 2002-02-05 16:34 UTC (permalink / raw)
  To: 9fans

I don't really feel like most of those line counts
are comparable, since it's not clear how much is 
there.  If you want something else that is not
really comparable, note that the TeX add-on package
for Plan 9 is almost the same size as the "everything else"
base package.

As for why, there certainly exists a small class of programmers
that actively believes writing complex programs is
just macho.  To them, I admit: I am not man enough to
keep up with your layers upon layers of complexity.
When I run into code they have written, I inevitably
complain to whoever will listen until I get fed up
enough to rewrite it.  To some extent, Mel is in this
class, although he understands programs as craft too.

At the same time, I think most programmers just don't
understand that programs are intended to be read by humans.
They fiddle until it works and then don't see the point
to doing it over again in a cleaner, simpler, more elegant
manner.  Especially if someone is being measured by some
bogus productivity metric like like lines of code written,
papers published, or problem sets handed in.

Good programming is like good writing in any subject;
it happens only by much revision and practice.  The sad
thing is that at least in my experience, introductory
programming courses just don't get that across.  (In fact,
in my experience most writing courses state that but then
do a poor job of backing it up.)  I helped to teach an
introductory computer science theory course for three years,
and we had the same problems there.  Students didn't
see any point to distilling a correct yet awkward proof
down to its essence; after all, it was correct, wasn't it?
(I don't know if this was natural or they got it from
taking intro to programming the year before.)
Even so, we didn't give much opportunity to help
them rewrite their proofs.  We did hand out the best
most elegant proofs we had on the solution sets,
and I think that helped somewhat, but I'm still not
sure how many internalized the message.

End of rant.
Russ


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] XP (was: code complexity)
@ 2002-02-06  0:10 geoff
  2002-02-06  0:29 ` [9fans] code complexity George Michaelson
  0 siblings, 1 reply; 14+ messages in thread
From: geoff @ 2002-02-06  0:10 UTC (permalink / raw)
  To: 9fans

I haven't read enough about XP to comment on most of it, but I dislike
the idea of pair programming.  There's nothing wrong with someone else
reading my code, but I need some quiet and calm to program, so having
someone nattering in my ear, second-guessing me is going to be a
disaster.  And how is the other member of the pair selected?  Having
someone you don't like or don't agree with as your partner would be
even more galling.  It would be like being part of a team that isn't
self-selected but imposed by management (actually a ``team'' in that
case, since it's not real).  And how do you program at home or when
travelling?  Pick some random person as your partner?  Go it alone?



^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] code complexity
@ 2002-02-05 16:41 Russ Cox
  0 siblings, 0 replies; 14+ messages in thread
From: Russ Cox @ 2002-02-05 16:41 UTC (permalink / raw)
  To: 9fans

> Bad programmers build complex stuff because they can and they get
> away with it most of the time, until it all comes crashing down.

That was the second paragraph.  I assert the existence of good
programmers who just believe that making complex things is cool.



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [9fans] code complexity
@ 2002-02-05 14:24 Richard Uhtenwoldt
  2002-02-05 14:47 ` Matt H
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Uhtenwoldt @ 2002-02-05 14:24 UTC (permalink / raw)
  To: 9fans

Most of the people on this list value "elegance" in source code.  To
them, a solution that requires 1000 lines of code is almost always
better than one that requires 10,000 lines as long as both solutions
solve the same set of problems.  Let us use the phrase "code complexity"
or "software complexity" to refer to the mental effort needed to
understand a piece of code.  Number of lines of source code, excluding
comments, is the easiest measure for estimating code complexity.

Whereas the people on this list tend to view code complexity as a cost
to be minimized/pessimized, many people --including probably most
programmers-- do not.  They may object to "code bloat" as a waste of
memory or cpu cycles or diskspace, but that is a different thing than
objecting to large source code sizes because they makes the code
unnecessarily difficult to understand, maintain and modify.  Some people
actually welcome code complexity, eg, some managers and economists even
today measures programmer "productivity" in lines of source code
produced.

Few on this list are going to disagree with the statement that the
popular desktop and server platforms are significantly more complex than
necessary.  but some numbers might be fun.

The Debian distribution of Linux contained 55,000,000 lines of code as
of 18 months ago.  (Includes all software including very specialized
stuff, eg, specialized for plane pilots, doctors, etc.)  Probably double
that now.

http://people.debian.org/~jgb/debian-counting/

the Mozilla web browser over 2,000,000 lines.  gcc 984,000.  I did not
inquire whether that included the g++ code to compile C++.

http://www.dwheeler.com/sloc/redhat71-v1/summary

The idea that complexity is a cost to be minimized is not new.  Dijkstra
devoted his Turing Award lecture to it in 1972 ("The Humble
Programmer").  And yet, it is still decidedly a minority view, even
among programmers.  Why?


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-02-06 20:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-05 16:34 [9fans] code complexity Russ Cox
2002-02-05 16:39 ` Boyd Roberts
2002-02-05 16:42   ` Ronald G Minnich
2002-02-05 17:20     ` david presotto
2002-02-05 23:06       ` Steve Kilbane
2002-02-05 20:24 ` philw
2002-02-06  1:01   ` ozan s yigit
2002-02-05 22:28 ` Dan Cross
  -- strict thread matches above, loose matches on Subject: below --
2002-02-06  0:10 [9fans] XP (was: code complexity) geoff
2002-02-06  0:29 ` [9fans] code complexity George Michaelson
2002-02-06 10:47   ` Boyd Roberts
2002-02-06 20:49     ` Andrew Simmons
2002-02-05 16:41 Russ Cox
2002-02-05 14:24 Richard Uhtenwoldt
2002-02-05 14:47 ` Matt H

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).