home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!destroyer!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.programming
- Subject: Re: Teaching the basics
- Message-ID: <1992Aug26.172830.21172@organpipe.uug.arizona.edu>
- Date: 26 Aug 92 17:28:30 GMT
- References: <MJN.92Aug23031941@pseudo.uucp> <7116@charon.cwi.nl> <1992Aug25.174243.10436@uwm.edu> <1992Aug26.111240.8239@ITcorp.com> <PSU.92Aug26091352@ptero.cs.duke.edu>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Organization: University of Arizona
- Lines: 41
- In-Reply-To: psu@cs.duke.edu (Peter Su)
-
- In article <PSU.92Aug26091352@ptero.cs.duke.edu>, psu@cs (Peter Su) writes:
- >In article <1992Aug26.111240.8239@ITcorp.com> geoff@ITcorp.com (Geoff Kuenning) writes:
- >
- > >...
- > > else if (Prev->Key < Key) Prev->Left = Cur; else Prev->Right = Cur;
- >
- > I find it sourly this code was on a thread named "Teaching the
- > basics", since the author obviously hasn't even learned the basics of
- > readable code formatting.
- >
- >Learn to use indent, or Emacs C-mode.
- >
- >Code formatting is irrelevant
-
- No it isn't. Unlike computers, humans understand the code they look at
- largely through visual cues offered by the layout of the code. This is
- no doubt why flame wars about indentation style can be so hot: reading
- code in an unfamiliar style is more difficult because the visual cues
- are different, and probably misleading (at least to the unfamiliar reader).
-
- >because programs like indent let you format the code anyway you like.
-
- But what about the author of the code? Good writing has always been about
- the clear presentation of ideas, and I submit that this is as true of code
- as it is of human languages. Moreover, the clear presentation of algorithms
- in code is more than just choosing the right data structures and good
- variable names. It is also presenting the code so that it can be easily
- understood.
-
- If the author of a piece of code can't format the code clearly, one begins
- to wonder what other skills s/he lacks. Just like poor spelling in human
- languages, nothing says `amateur' louder than poor code formatting in
- programming languages.
-
- >It's amazing to me that universities waste so much time and effort
- >teaching people how to format code.
-
- Maybe they know something you don't.
-
- --
- Dave Schaumann dave@cs.arizona.edu
-