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-Thread: 103376,587e0e0a16d65b10 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Invade wikipedia! Date: Wed, 25 Feb 2009 09:05:59 +0100 Organization: Jacob Sparre Andersen Message-ID: References: <1tw8gryqdolal$.1osqedj9x821c.dlg@40tude.net> <5c44eaae-631d-46d2-8384-86af79d5e048@n20g2000vba.googlegroups.com> <944a1924-0fa7-487f-a94d-084a2be1b231@v31g2000vbb.googlegroups.com> <9f2553d3-66f5-4708-a237-bfef1d8404f4@v42g2000yqj.googlegroups.com> NNTP-Posting-Host: taasingegade.news.jacob-sparre.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1235549159 16146 85.82.239.166 (25 Feb 2009 08:05:59 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 25 Feb 2009 08:05:59 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:6UAQ3rxfQV6cS5dEhJVfPx8ZcIQ= Xref: g2news2.google.com comp.lang.ada:4761 Date: 2009-02-25T09:05:59+01:00 List-Id: Bill wrote: > Martin wrote: >> Sorry my made up example doesn't cut mustard! Does this make it any >> clearer? :-) >> >> ------------------------ >> -- Calculate_Velocity -- >> ------------------------ >> >> procedure Calculate_Velocity >> (Speed : Meters_Per_Second; >> Time : Seconds; >> Velocity : out Meters_Per_Second_Per_Second); > > Nope! > The reason why is left as an exercise for the student. 8-) I'm not really a student any more, but now that the students have had their chance ... There are several problems with this: + The subroutine doesn't do what its name says it does (physicists see this easily). + Since the subroutine only returns a single, simple object, it would typically make much more sense implementing it as a function. + In the specific discussed context (programming example wikis), each subroutine usually already stands out alone. + Comments are inherently dangerous (since they are not checked by the compiler). Greetings, Jacob -- "Never trust a statistic you have not falsified yourself."