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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,92c39a3be0a7f17d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-13 07:16:43 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: kcline@optelnow.net (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: Future with Ada Date: 13 Mar 2002 07:16:43 -0800 Organization: http://groups.google.com/ Message-ID: References: <3C7FB9D2.D9C6E055@boeing.com> <3C81DF1F.9000503@mail.com> <3C83A112.6080302@mail.com> <3C84223C.A356F466@adaworks.com> <3C853A04.34826F39@despammed.com> <3C8D0D70.BB09F3DA@despammed.com> NNTP-Posting-Host: 198.23.5.11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1016032603 363 127.0.0.1 (13 Mar 2002 15:16:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 13 Mar 2002 15:16:43 GMT Xref: archiver1.google.com comp.lang.ada:21159 Date: 2002-03-13T15:16:43+00:00 List-Id: "Marin David Condic" wrote in message news:... > ...One 400 line subroutine becomes four 100 > line routines with a "main" to call each in sequence, eh? :-) Well, that would be better, although even 100 lines is rather long. Why? Because understanding or testing a 400-line subroutine is considerably more than four times as difficult as understanding or testing four 100-line subroutines. Presumably you don't have 400 uncommented lines, so your 400-line subroutine is going to be sprinkled with comments like -- do something ... code to do something ... -- do something else ... code to do something else ... -- do another thing ... Extract each block of code to a separate function named by the comment preceding the block: do_something() do_something_else() do_another_thing() If the argument lists to the subroutines are long, then consider introducing a new type to hold the data passed between the subroutines.