Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Style Police (a rant) Date: Wed, 14 Sep 2011 18:06:58 -0700 (PDT) Organization: http://groups.google.com Lines: 54 Message-ID: <91a5b51c-f2d2-4d2e-8bfb-bc875d0bbb6d@glegroupsg2000goo.googlegroups.com> References: <4e6c0fce$0$310$14726298@news.sunsite.dk> <4e6d1fc5$0$308$14726298@news.sunsite.dk> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 2620:0:1000:fd42:224:d7ff:fe69:5838 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1316049204 10095 127.0.0.1 (15 Sep 2011 01:13:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 15 Sep 2011 01:13:24 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2620:0:1000:fd42:224:d7ff:fe69:5838; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8042 Eric Sosman wrote: > Andreas Leitgeb wrote: >> A more interesting percentage might be: maintaining one's own code versus >> maintaining someone else's code. > > This is important. If you advocate code re-use, it follows that > you advocate spending more time maintaining and less originating. If > your preferences run the other way, you are not re-using enough code. > > When I was young (shovelling coal into the furnaces of the early > steam-powered computers, and leering lasciviously at Lovelace), memory > was short and CPU cycles long: Both were scarce and hence expensive. > Programmer labor (sometimes called human labor, but that's debatable) > was cheap in comparison. The product of that labor was therefore also > cheap, easy to discard and re-write. "Re-doing it better" was laudable. > > But memories have grown and CPU cycles have shrunk. I recall a > machine whose time was billed at $100/hour, during which time it could > perform maybe 0.3 billion instructions (if it never had to wait for > I/O and there wasn't too much floating-point in the mix). Today's > machines can get through 0.3 billion instructions in a second or two: > That's more than three decimal orders of magnitude faster. That same > machine deployed 1/8 MB of memory; nowadays even a bare-bones El Cheapo > laptop has 2 GB, four decimal orders of magnitude more. And the old > machine cost maybe $500,000 instead of $700 (which is about $125 in > 1970 dollars), for another three-plus decimal orders of magnitude > improvement. > > Meanwhile, the appetite for code -- the demand for programmer > output -- has risen, and although the supply of programmer labor has > increased and the tools of programmer productivity have improved, they > have not kept pace with demand. The balance is reversed: Programmer > time is scarce and expensive, CPU time and memory are plentiful and > cheap. > > So if you want to produce software cost-effectively, it follows > that you *must* re-use existing code. And if you must re-use code, > it follows that you must maintain it -- and the really cost-effective > programmer, the one who will get to market first and with lower > overheads than the competition, will be the one who writes *no* > original code at all. It's too slow and expensive, and too last > millennium. > > Ponder this, while thinking about the average Computer Science > curriculum. "Students, today you will implement an AVL tree." Bah! "Thou shalt re-use code!" is a dogma that doesn't always apply. "Thou shalt conserve programming time and effort whilst reducing error!" does. Sometimes copy-and-modify is cheaper in both time and error-proneness than re-use. I would say quite often it is. -- Lew