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