home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / programm / 2483 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  2.3 KB

  1. Path: sparky!uunet!gatech!destroyer!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.programming
  4. Subject: Re: Teaching the basics
  5. Message-ID: <1992Aug26.172830.21172@organpipe.uug.arizona.edu>
  6. Date: 26 Aug 92 17:28:30 GMT
  7. 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>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 41
  12. In-Reply-To: psu@cs.duke.edu (Peter Su)
  13.  
  14. In article <PSU.92Aug26091352@ptero.cs.duke.edu>, psu@cs (Peter Su) writes:
  15. >In article <1992Aug26.111240.8239@ITcorp.com> geoff@ITcorp.com (Geoff Kuenning) writes:
  16. >
  17. >   >...
  18. >   >    else if (Prev->Key < Key) Prev->Left = Cur; else Prev->Right = Cur;
  19. >
  20. >   I find it sourly this code was on a thread named "Teaching the
  21. >   basics", since the author obviously hasn't even learned the basics of
  22. >   readable code formatting.
  23. >
  24. >Learn to use indent, or Emacs C-mode.
  25. >
  26. >Code formatting is irrelevant
  27.  
  28. No it isn't.  Unlike computers, humans understand the code they look at
  29. largely through visual cues offered by the layout of the code.  This is
  30. no doubt why flame wars about indentation style can be so hot: reading
  31. code in an unfamiliar style is more difficult because the visual cues
  32. are different, and probably misleading (at least to the unfamiliar reader).
  33.  
  34. >because programs like indent let you format the code anyway you like.
  35.  
  36. But what about the author of the code?  Good writing has always been about
  37. the clear presentation of ideas, and I submit that this is as true of code
  38. as it is of human languages.  Moreover, the clear presentation of algorithms
  39. in code is more than just choosing the right data structures and good
  40. variable names.  It is also presenting the code so that it can be easily
  41. understood.
  42.  
  43. If the author of a piece of code can't format the code clearly, one begins
  44. to wonder what other skills s/he lacks.  Just like poor spelling in human
  45. languages, nothing says `amateur' louder than poor code formatting in
  46. programming languages.
  47.  
  48. >It's amazing to me that universities waste so much time and effort
  49. >teaching people how to format code.
  50.  
  51. Maybe they know something you don't.
  52.  
  53. -- 
  54. Dave Schaumann            dave@cs.arizona.edu
  55.