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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.55.165.201 with SMTP id o192mr3797760qke.39.1506344895251; Mon, 25 Sep 2017 06:08:15 -0700 (PDT) X-Received: by 10.157.49.52 with SMTP id e49mr121073otc.18.1506344895099; Mon, 25 Sep 2017 06:08:15 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!q8no3036212qtb.0!news-out.google.com!p6ni3277itp.0!nntp.google.com!o200no2141630itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Sep 2017 06:08:14 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2003:c7:83cd:c3fb:d4cb:4743:285f:5a65; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 2003:c7:83cd:c3fb:d4cb:4743:285f:5a65 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3ca74d75-f942-4e06-a389-cddb77ec244f@googlegroups.com> Subject: Re: My first test of github: cpros - lightweight Ada command processor From: AdaMagica Injection-Date: Mon, 25 Sep 2017 13:08:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:48211 Date: 2017-09-25T06:08:14-07:00 List-Id: A quote from the README: "You have to dig into the source code of cpros_test1 to figure out more if = you want to use this simple (but for me useful) tool." Am I the only one who finds this attitude terrible and unbearable for softw= are engineering practices? So let's peek at the code. There is a file rsplit.ads. Hm, what's R? Split,= OK... or is it the slovenian town Split? There are no comments inside inlightening me about Rsplit. Inside: White_Space is not really white, but OK, I would perhaps choose the= same name. There is a function Number_of_Words with a parameter FS. FS doesn't tell me= anything - just a string. Function Word, parameter FS, the same as before; parameter S? Word_Number: Natural. No idea what this might be... Now switch on my superman brain: A, FS might mean Full_String and Word retu= rns the word with position Word_Number. So S might mean Word_Separator. Why= the hell doesn't the author say so? Ah, no, S is a string. So is any chara= cter in S a separator or the full S? Ah, Word_Number starts with 0. Hm, are words within FS counted 0, 1, ... or= do they start with 1? And what happens if Word_Number is out of range 0 (o= r 1) .. Number_of_Words. Constraint_Error or does it return ""? Uh, ah! The parameter S is only in Word. Number_of_Words doesn't have it. N= ow I'm confused. How can Number_of_Words and Word work together correctly i= f only one knows what to use as the separator? --------- So please, please use telling names. It doesn't take so much longer to inve= nt them and write them down. And comment how the code is to be used! Look at the RM to which extent the language defined subprograms are desribe= d. "Look into the code how it is used" is not the way to go.