Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!clyde!cbosgd!mandrill!hal!ncoast!btb From: btb@ncoast.UUCP (Brad Banko) Newsgroups: comp.lang.misc Subject: Re: Language tools for good code Message-ID: <7166@ncoast.UUCP> Date: 31 Jan 88 16:27:25 GMT References: <4000009@nucsrl.UUCP> Reply-To: btb@ncoast.UUCP (Brad Banko) Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 39 vance, in response to your posting about 'good' code, i agree with your definition of good code being code that can be understood and changed easily, but there is an implicit assumption about a reader's experience and ability to understand code... clearly, a program doesn't have to document in complete detail the theory and nature of its algorithms, unless you would want to include chapters from Knuth in the header comment of every module. i think that the modularity is important, and this is one place that pascal falls down, but apparently modula2 makes up for it... the really good aspect of pascal/modula2 is that complex data types are very easy to clearly declare... types of types, etc., and this is supported in the parameter definition syntax for subroutines, etc. a major advantage of C is its 'economy of expression', which, when combined with modular programming habits (no module is larger than one page, top down design) makes it easy for a reader to see the 'big picture' of the code. i don't think that these languages lack any tools to write good code, but the responsibility still lies with the programmer to practice modular programming. perhaps a first approximation to enforcing good code is to write a shell for writing source code that enforces a minimum documentation and modular programming standard... enforces a top down approach by limiting all code sections to one page, and enforces documentation by requiring the programmer to complete a minimum required header comment documenting all significant data structures. i am not saying that this needs to be dictated to a programming team, but i am sure that any programming team familiar with large projects is familiar with these types of concepts and could decide on standards by committee. -- Brad Banko Columbus, Ohio (formerly ...!decvax!cwruecmp!ncoast!btb) btb%ncoast@mandrill.cwru.edu "The only thing we have to fear on this planet is man." -- Carl Jung, 1875-1961