From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 4 Dec 92 04:03:28 GMT From: seas.gwu.edu!mfeldman@uunet.uu.net (Michael Feldman) Subject: Re: (none) Message-ID: <1992Dec4.040328.22624@seas.gwu.edu> List-Id: In article <1992Dec3.155935.8187@inmet.camb.inmet.com> stt@spock.camb.inmet.com (Tucker Taft) writes: >In article <1992Dec3.094334.20038@sei.cmu.edu> > firth@sei.cmu.edu (Robert Firth) writes: > >>In article <9212022347.AA03025@s405.dseg.ti.com> > fmoore@sun405.dseg.ti.com (Freeman Moore) writes: > >>>We have a programming standard that limits the number of >>>executable statements in a compilation unit. >> >>There's the answer: change the standard. Presumably, this standard >>is meant to enhance code readability, testability, maintainability >>&c. Simply hacking out a chunk of code as "is separate" will not >>enhance any of the above, so the standard is defeating itself. > >I agree completely with Robert Firth on this one, and would go further. >Arbitrary limits on the size of a compilation unit are a mistake. [remainder deleted] Hmmm....deja vu all over again. I have in my office, somewhere, an old coding standard from a large (VERY large) company, to remain nameless. A pioneer in the old days of structured programming, this company's people were promulgating the idea - rule of thumb - that a module should be roughly 100 statements long, because that's two pages of listing, i.e. what you could spread out on your desk and take in with a sweep of the eyeball. The _rule of thumb_ was that if a module (I think they were talking Fortran or PL/I procedures) was much longer than that, it would be hard to debug and understand, and serious consideration should be given to its re-design, as it was probably functionally incoherent as well. Make sense? Sure. But somewhere along the line, this very useful rule of thumb was grabbed by a bureaucrat who turned it into a _Coding Standard_, to be enforced with all the ruthlessness for which Code Police are legendary. Naturally the Code Police did not understand the code they were reading; they just counted the LOC per module. You've probably guessed by now how the programmers responded, but what the hell, I'll tell you anyway. They simply chopped the long modules at 100-LOC intervals, making separate procedures (parameterless, I assume) out of each 100-LOC chunk. This satisfied the bureaucrats.... Beware of knee-jerk, ruthlesssly-enforced coding standards. Better to apply a little common sense. BTW - as a Distinguished Reviewer of the Ada Quality and Style guide, I'm happy to see the relatively softer tones in which this document - whose final version is nearing release - is speaking. That's one project in which common sense really does seem to be winning. Cheers - Mike Feldman ------------------------------------------------------------------------ Michael B. Feldman co-chair, SIGAda Education Committee Professor, Dept. of Electrical Engineering and Computer Science School of Engineering and Applied Science The George Washington University Washington, DC 20052 USA (202) 994-5253 (voice) (202) 994-5296 (fax) mfeldman@seas.gwu.edu (Internet) "Americans want the fruits of patience -- and they want them now." ------------------------------------------------------------------------