home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / software / 5058 < prev    next >
Encoding:
Text File  |  1992-12-20  |  2.7 KB  |  62 lines

  1. Newsgroups: comp.software-eng
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!spool.mu.edu!umn.edu!csus.edu!netcom.com!mcgregor
  3. From: mcgregor@netcom.com (Scott Mcgregor)
  4. Subject: Re: C code Layout
  5. Message-ID: <1992Dec18.065408.10837@netcom.com>
  6. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  7. References: <1992Dec14.074411@eklektix.com> <1992Dec14.175533.8400@fcom.cc.utah.edu> <1gqd2tINN5o5@mirror.digex.com>
  8. Date: Fri, 18 Dec 1992 06:54:08 GMT
  9. Lines: 51
  10.  
  11. Related story:
  12.  
  13. Back in the mid-late 70's I was consulting on a project.  Part of this
  14. involved reviewing code that had been written by an outside contract
  15. firm. These programs were written in statement oriented (as opposed
  16. to line oriented like BASIC, FORTRAN, and COBOL) languages like C,
  17. Pascal and PL/I . The people who had written this had run a special
  18. filter on the programs. These filters removed all the comments, and
  19. also all extra white space (tabs, repeated, or unnecessary spaces).
  20. Also, all variable names were two characters long, e.g. i1, i2....
  21.  
  22. When I complained that I was having a hard time reading these "text
  23. flowed" programs, the author just suggested that I write a pretty
  24. printer program that reformatted them in a way that I liked (like one
  25. statement per line, with indentations, etc.) I pointed out that with
  26. the two character variable names and comments stripped out that it
  27. would still be hard, but the author claimed that an algorithm is
  28. independent of the variable names chosen and should be deducable even
  29. without comments. 
  30.  
  31. I finally asked why the author even bothered to write this
  32. reformatting program and use it.  He answered that he had been used to
  33. programming very small computers for industrial controllers and that
  34. this was a trick he learned--he realized that stripping the comments,
  35. keeping the variable names short, and removing white space would save
  36. the parser of the compiler from having to spend time processing
  37. semantically non-meaningful components would make the compile take
  38. less time.  This was therefore more efficient.
  39.  
  40. While I couldn't disagree with his efficiency claim, I wasn't sure
  41. that he was maximizing the right resource. Especially since this
  42. wasn't compiled on  a slow and limited controller, but a DEC 10, which
  43. was rather powerful for the day.
  44.  
  45. I've never seen views so extreme since, but I've heard many similar
  46. arguments that bring this experience to mind from time to time.
  47.  
  48.  
  49. -- 
  50.  
  51. Scott L. McGregor        mcgregor@netcom.com
  52. President            tel: 408-985-1824
  53. Prescient Software, Inc.    fax: 408-985-1936
  54. 3494 Yuba Avenue
  55. San Jose, CA 95117-2967
  56.  
  57. Prescient Software sells Merge Ahead, the tool for Merging Text or Code and
  58. offers consulting  & training in project management and design for usability.
  59.  
  60.  
  61.  
  62.