From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,23963231b5359f74 X-Google-Attributes: gid10ad19,public X-Google-Thread: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-05 06:47:03 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.mesh.ad.jp!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml From: Ted Dennison References: <83WP6.3874$yc6.728572@news.xtra.co.nz> <3B1411D0.3AAF42E7@ftw.rsc.raytheon.com> <9f2nks$ibd$0@dosa.alt.net> <3B177EF7.2A2470F4@facilnet.es> <9f8b7b$h0e$1@nh.pace.co.uk> <9f8r0i$lu3$1@nh.pace.co.uk> <9fgagu$6ae$1@nh.pace.co.uk> <9fi87m$9du$1@bugstomper.ihug.com.au> Subject: Re: Long names are doom ? Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Tue, 05 Jun 2001 09:46:15 EDT Organization: http://www.newsranger.com Date: Tue, 05 Jun 2001 13:46:15 GMT Xref: archiver1.google.com comp.lang.ada:8151 comp.lang.awk:2765 comp.lang.clarion:21101 comp.lang.java.programmer:73663 comp.lang.pl1:760 comp.lang.vrml:3492 Date: 2001-06-05T13:46:15+00:00 List-Id: In article <9fi87m$9du$1@bugstomper.ihug.com.au>, Blaikie says... > >rather than making every method less than a screen long (again a rather >arbitrary measure of code length, especially seeing as different ppls >resolutions effect what a 'screen' of code is), u only need to seperate >resused code into seperate methods, if u have one method that is 10 pages >long, but there is no reptition and the code is used nowhere else, why make >it into seperate methods? yes a few comments, and alot of thought about the Any routine that is 10 pages long is doing a *lot* of stuff. Perhaps in high-level terms you can express what it is doing succinctly, but at the level that the routine actually operates, you can't. If you can't express what the routine is doing succinctly, at the level it operates, then a maintainer is going to have to read through 10 screens of code to figure it out themselves. The author might even get confused on the subject from time to time. Bugs are going to be tougher to spot and track down because you'll have to rethink the subject of exactly what the routine is supposed to be doing every time you revisit it. Additionally, I find that I often end up with *less* code when I split a big routine up into smaller ones. The data flow is also easier to follow because what were routine-wide globals that could be modified anywhere within 10 screens of code often turn into parameters that only go into one or two of the new smaller routines. Its also much better commented, becuase I always have a header comment for every routine describing its purpose and what it does. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com