comp.lang.ada
 help / color / mirror / Atom feed
* Using ARRAYS for grade reporting?
@ 1998-04-18  0:00 Sam
  1998-04-19  0:00 ` GOTHIC SIN
  0 siblings, 1 reply; 8+ messages in thread
From: Sam @ 1998-04-18  0:00 UTC (permalink / raw)



I am trying to write an ADA program that will read names and grades of
students into two ARRAYS.  And then print out a table reflecting pass or
failing.  I am stuck.  Any assistance would be appreciated.  Thanks





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
  1998-04-19  0:00 Using ARRAYS for grade reporting? tmoran
@ 1998-04-19  0:00 ` Robert Dewar
  1998-04-21  0:00   ` Tom Moran
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Dewar @ 1998-04-19  0:00 UTC (permalink / raw)



tmoran says

<<It would be nice to distinguish between fact and opinion in messages.

>(remembe that the use of String here is just plain wrong :-))
 This is a fact about the Ada language and Ada compilers.
>But another point is that the use of plurals for the field names is
>styulistically incorrect. The field names should be Name and Grade
 This is an opinion of the author (which I share), not a fact.
Unless of course somebody has actually done research conclusively
demonstrating that using plural field names substantially increases
the error rate, or does something else bad, to programs.
>>


That's why I sent two separate messages, the first a tecnical note on
the use of String. The second was clearly labeled as being *stylistically*
incorrect. Matters of style are definitely less objective. However, I would
not be willing to say they are mere matters of opinion. This particular
case is a rather clear one. The use of the word Grades to refer to a single
grade is definitely a bad idea.

There are attempts in the field of "software physics", to objectively measure
the effect of such stylistic choices, but it is not clear that the rather
soft statistics that come from such studies can conculsively demonstrate
anything. It is very hard to eliminate all other variables from such 
measurements.

But in my opinion, it would be a big mistake to take the attitude that
stylistic points should be ignored unless backed up by such supposed
"evidence". You will often find broad agreement on stylistic issues
based on experience, and it would be a mistake to ignore such
experience (after all Tom Moran notes that he agrees with the point I made,
and I expect that most experienced Ada programmers would agree with us.

It is certainly not easy to always obtain agreement (dig up the recent thread
on type names for an example of this), but there are broad consensus
positions that are worth recognizing, even in the absence of "conclusive"
evidence.

Certainly a position on an issue of style is not a fact! That's the meaning
of the word style in connection with programming languages. It refers to
rules of programming that are NOT mandated by the language!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
@ 1998-04-19  0:00 tmoran
  1998-04-19  0:00 ` Robert Dewar
  0 siblings, 1 reply; 8+ messages in thread
From: tmoran @ 1998-04-19  0:00 UTC (permalink / raw)



It would be nice to distinguish between fact and opinion in messages.

>(remembe that the use of String here is just plain wrong :-))
 This is a fact about the Ada language and Ada compilers.
>But another point is that the use of plurals for the field names is
>styulistically incorrect. The field names should be Name and Grade
 This is an opinion of the author (which I share), not a fact.
Unless of course somebody has actually done research conclusively
demonstrating that using plural field names substantially increases
the error rate, or does something else bad, to programs.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
  1998-04-18  0:00 Sam
@ 1998-04-19  0:00 ` GOTHIC SIN
  1998-04-19  0:00   ` Robert Dewar
  0 siblings, 1 reply; 8+ messages in thread
From: GOTHIC SIN @ 1998-04-19  0:00 UTC (permalink / raw)



Why don't  you use a RECORD?

Type Grade_report_record is RECORD
    Names : string;
    grades : character; -- or you can use the numeric grade natural
                                      -- or float.
end record;

goth   
 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
  1998-04-19  0:00 ` GOTHIC SIN
@ 1998-04-19  0:00   ` Robert Dewar
  1998-04-19  0:00     ` Robert Dewar
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Dewar @ 1998-04-19  0:00 UTC (permalink / raw)



GOTHIC SIN said

<<Why don't  you use a RECORD?

Type Grade_report_record is RECORD
    Names : string;
    grades : character; -- or you can use the numeric grade natural
                                      -- or float.
end record;

goth
>>


In order to avoid the "blind-leading-the-blind" phenomenon which can be
very confusing, I strongly suggest that unless you are a real expert in
Ada (and perhaps even then -- I always do) *compile* your code before
posting it to make sure that it does not have obvious errors.

The above code is of course wrong, you cannot use the type String here. There
are many possible corrections (constrain the string, use Unbounded_String,
use a discriminant ...) depending on the exact need.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
       [not found] <01bd6b1c$38b6c3c0$0e2915c0@p5120>
@ 1998-04-19  0:00 ` GOTHIC SIN
  0 siblings, 0 replies; 8+ messages in thread
From: GOTHIC SIN @ 1998-04-19  0:00 UTC (permalink / raw)



Don't use an Array.  Use a record.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
  1998-04-19  0:00   ` Robert Dewar
@ 1998-04-19  0:00     ` Robert Dewar
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Dewar @ 1998-04-19  0:00 UTC (permalink / raw)



One more comment on

<<Type Grade_report_record is RECORD
    Names : string;
    grades : character; -- or you can use the numeric grade natural
                                      -- or float.
end record;
>>


(remembe that the use of String here is just plain wrong :-))

But another point is that the use of plurals for the field names is
styulistically incorrect. The field names should be Name and Grade
(please also use consistent casing conventions, the above example is
all over the place with respect to that requirement as well!)





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using ARRAYS for grade reporting?
  1998-04-19  0:00 ` Robert Dewar
@ 1998-04-21  0:00   ` Tom Moran
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Moran @ 1998-04-21  0:00 UTC (permalink / raw)



>it is not clear that the rather
>soft statistics that come from such studies can conculsively demonstrate
>anything
I'd hate to think we were telling people "X is better than Y.  I have
no evidence, and the difference between X and Y  is so small as to not
be measurable, but, hey, I just happen to believe X is better than Y".

  What is it that makes the "soft statistics that come from such
studies" so useless?  What needs to be changed to get conclusive
demonstrations of propositions?  And I wouldn't demand "conclusive" in
the sense of "less than 1% chance of the null hypothesis", but would
be quite happy with a "75% chance you'll save money, and 25% chance
you'll save a bundle of money" type of statement..




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1998-04-21  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-19  0:00 Using ARRAYS for grade reporting? tmoran
1998-04-19  0:00 ` Robert Dewar
1998-04-21  0:00   ` Tom Moran
     [not found] <01bd6b1c$38b6c3c0$0e2915c0@p5120>
1998-04-19  0:00 ` GOTHIC SIN
  -- strict thread matches above, loose matches on Subject: below --
1998-04-18  0:00 Sam
1998-04-19  0:00 ` GOTHIC SIN
1998-04-19  0:00   ` Robert Dewar
1998-04-19  0:00     ` Robert Dewar

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