home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!agate!linus!linus.mitre.org!church.mitre.org!crawford
- From: crawford@church.mitre.org (Randy Crawford)
- Newsgroups: comp.programming
- Subject: Re: Teaching by Value (was Re: Teaching the Basics)
- Message-ID: <1992Aug20.044100.15875@linus.mitre.org>
- Date: 20 Aug 92 04:41:00 GMT
- References: <1992Aug18.230426.26425@lucid.com> <1992Aug19.135744.14889@husc13.harvard.edu> <1992Aug19.142513.14893@husc13.harvard.edu>
- Sender: news@linus.mitre.org (News Service)
- Organization: The MITRE Corporation, McLean, VA
- Lines: 37
- Nntp-Posting-Host: church.mitre.org
-
- In article <1992Aug19.142513.14893@husc13.harvard.edu> peregrin@husc13.harvard.edu writes:
- ...
- > Should efficiency really be a concern at the introductory
- >level? Should that concern be reduced so that more time can be spent on
- >problem solving?
- >
- > If you look at your programming peers, are you more concerned that
- >they can write easily maintainable code than if they can write super-slick
- >fast routines? Who do you want on your programming team? Should the
- >majority of programmers be writers of clean, easy to read and maintain
- >code, and only a few are needed to right tight, fast, efficient routines?
-
- In the words of Samuel Johnson (as paraphrased by Charniak, McDermott, Riesbeck,
- and Meehan) "we advise you to look over your code very carefully, and whenever
- you find a part that you think is particularly fine, strike it out."
-
- I think efficiency is always a concern. However, there is efficient code and
- there is clever code. Efficient is good; clever (usually) is not. I see
- the difference as: efficient code is marked by a lack of waste; clever code is
- a weird trick which is unnaturally efficient. Weird code is interesting and
- fast, but is generally illegible, unmaintainable, and unextensible. Excessively
- efficient code is almost never worth its other excesses.
-
- The only time that cleverness may be preferable is in routines which will be
- reused extensively, as in libraries, or in computationally intensive algorithms
- where efficiency is everything.
-
- So in answer to your last question: Yes. Very few programmers need to be
- "clever". The rest of us should focus on writing efficient readable code.
-
- Randy
- crawford@mitre.org
- --
-
- | Randy Crawford crawford@mitre.org The MITRE Corporation
- | 7925 Colshire Dr., MS Z421
- | N=1 -> P=NP 703 883-7940 McLean, VA 22102
-