comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: My first test of github: cpros - lightweight Ada command processor
Date: Mon, 25 Sep 2017 06:08:14 -0700 (PDT)
Date: 2017-09-25T06:08:14-07:00	[thread overview]
Message-ID: <3ca74d75-f942-4e06-a389-cddb77ec244f@googlegroups.com> (raw)
In-Reply-To: <ca71d382-8bb8-486f-bb22-8225a9fd87ae@googlegroups.com>

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 software 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 returns 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 character 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 (or 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. Now I'm confused. How can Number_of_Words and Word work together correctly if only one knows what to use as the separator?
---------
So please, please use telling names. It doesn't take so much longer to invent 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 desribed. "Look into the code how it is used" is not the way to go.


  reply	other threads:[~2017-09-25 13:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-24 15:07 My first test of github: cpros - lightweight Ada command processor reinert
2017-09-25  7:20 ` reinert
2017-09-25 13:08   ` AdaMagica [this message]
2017-09-25 14:04     ` reinert
2017-09-25 16:14       ` AdaMagica
2017-09-25 17:51         ` reinert
2017-09-25 17:53         ` reinert
2017-09-25 17:59           ` reinert
2017-09-26  9:55           ` Brian Drummond
2017-09-26 12:56             ` reinert
2017-09-26 13:13               ` Dmitry A. Kazakov
2017-09-26 17:07           ` Simon Wright
2017-09-25 15:49     ` Frank Buss
2017-09-25 16:08     ` Jeffrey R. Carter
2017-09-25 18:34       ` reinert
2017-09-26 16:25         ` AdaMagica
2017-09-27  6:07           ` reinert
2017-09-27 16:16 ` Jacob Sparre Andersen
2017-09-27 17:15   ` reinert
2017-09-28  8:11   ` reinert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox