comp.lang.ada
 help / color / mirror / Atom feed
* Re: Distinguishing type names from other identifiers
@ 1998-01-13  0:00 Adam Beneschan
  1998-01-14  0:00 ` Brian Rogoff
  1998-01-19  0:00 ` who owns the code? was " Anonymous
  0 siblings, 2 replies; 41+ messages in thread
From: Adam Beneschan @ 1998-01-13  0:00 UTC (permalink / raw)



Nick Roberts wrote:

> The technique I generally use for inventing a type identifier distinct from
> identifiers I might use for objects and parameters of that type is to make
> the type identifier one step more specific (and thus, usually, longer).
>
> The justification for using a longer identifier for the type, rather than
> for the objects and parameters, is that type identifiers are generally used
> less often in practical source text.
>
> For example:
>
>    type Hour_Of_Day is range 0..23;
>    type Minute_Of_Hour is range 0..59;
>    type Seconds_Past_Minute is delta 0.001 range 0.000 .. 59.999;
>
>    function To_Seconds_Past_Midnight
>                    (Hour:    Hour_Of_Day;
>                     Minute:  Minute_Of_Day;
>                     Seconds: Seconds_Past_Minute) return Day_Duration;
>
> This example illustrates (I hope ;-) that the use of a plural or singular
> form for an identifier is not naturally to do with whether it denotes a
> type, an object, a parameter, a subprogram, or whatever, but rather with
> whatever concept it describes.  The choice of Seconds_Past_Minute is
> perhaps a little clumsy. . . .

After following this thread, and looking at this example, I really
wonder what the objection is to using _Type suffixes.  Several people
have objected to "_Type" on the ground that it doesn't add any
informational value to the name.  But do the extra words in the above
example add any value to the name, either?  I'm not convinced that
calling the type Hour_Of_Day is any more helpful to a programmer than
just calling it Hour or Hour_Type.

Of course, I could have picked a bad example to complain about, since
there could be a use for both "Minute_Of_Hour" and "Minute_Of_Day" or
"Minute_Of_Year" or "Minutes_Elapsed" types, or something like that.
But it seems to me that in many, many cases, there just isn't any
extra value to add to the name.  So *anything* you add, whether it's a
boring suffix like _Type or a boring prefix like The_, or something
less boring that appears to contain additional information as in the
above example, is still just "noise"---in essence, a kludge to keep
the compiler happy.

So if I'm right and anything you add is just noise, I think it may be
best to use a boring suffix like _Type.  The small advantage to this
is that it may make your names easier to remember.  If you use _Type
consistently, at least you have less information to carry around in
your head, instead of trying to remember something different for each
type: "Now, let's see, did I call this one _Number, or _Of_Day, or
_Of_Hour, or what?" leading to potential errors such as the one Nick
included in his above example.

                                -- Adam

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet




^ permalink raw reply	[flat|nested] 41+ messages in thread
* Re: who owns the code? was Re: Distinguishing type names from other identifiers
@ 1998-01-22  0:00 Marc Wachowitz
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Wachowitz @ 1998-01-22  0:00 UTC (permalink / raw)



<rant apology=no>

Paul Van Bellinghen <pvanbell@mhv.net> wrote:
> I can tell you from experience that an engineer needs to have a circuit
> (HW engineer) or a piece of code (SW engineer) that he/she feels that was
> created (and maintained) by them in order to feel a sense of satisfaction
> in their contribution to the project.

It may be true for your own experiences so far, and for the experiences
so far of quite a few other people, but it isn't always true (and it might
even some day cease to be true for you, one never knows ;-). For example,
for me, both the most satisfying and the most effective motivation wrt. to
quality of the result is interest in the process itself (referring to the
social as well as technical factors) and in the product - at least beyond
a point where some very basic material requirements for living are met.
Of course there are necessary partial tasks which hardly anyone will enjoy
performing, but the intelligent reaction is to find ways to reduce them, as
far as direct involvement of humans is concerned (as someone said, program
development is intelligent laziness), and not to hand it down to unfortunate
losers in an insane form of competition, which is inhumane (and does waste
a lot of human potentials, too).

> Recall that we who live in a capitalistic system believe that private
> ownership and competition result in a higher quality of products overall.
> This is proven by a comparison with the products produced by socialistic/
> communistic systems of government.

<social-philosophy>
Clearly, there's a tendency towards "product ownership" - whether by a group
or by an individual - built into the current social/economical structure, but
that doesn't at all mean that I'd like it. I don't like it, but it does take
more than a few people to change this setup. I do carefully look at the subtle
influences this environment does have on mentality, and try not to let it take
root there, even though in many cases - far beyond the range of some obvious,
isolated decisions - it's hard to avoid following these patterns; that doesn't
preclude a critical view about this. As far as the supposed "success" alluded
to above is concerned, it's only true wrt. the popular confused usage of those
notions. So-called "socialistic" countries effetively had a more government-
(or state)-oriented capitalism, opposed to a more market-oriented capitalism,
which are both variations of the same fundamental structures, which are both
subject to Marx' Critique of Political Economy, and the more recent continued
development of Critical Theory (advanced by philosophers like Max Horkheimer
or Theodor W. Adorno). There's no need to be fooled by those countries' silly
propaganda pretending to have anything but cliches common with the notion of
communism, which would have to be a movement overthrowing this mess, a free
association of free individuals, which cannot be based on oppression.
</social-philosophy>

> People need to feel a sense of pride in the goods and services they produce
> in order for them to produce those goods and services to the best of their
> ability. This directly translates into quality.

<psychology>
Why make a detour via pride, with all its negative baggage, and not work
towards a social structure and climate where joy is derived from what's
actually going on, and can be shared with other humans without all those
pointless fights for (psychical or material) "territory"? Let's say you're
enjoying a beautiful sunset, something in which you'd hardly take pride,
and someone else is also enjoying it. Does their joy reduce your joy? I'd
guess it doesn't, and likewise, I don't see why pride should be somehow
positive. If humans appear to need to add pride to find joy, what does
that tell us about an environment which puts forth those conditions? The
human mind doesn't exist independent from the society by which it is formed
and which it is forming. Personally, I'd rather reduce such attachment; it
looks like it's no more conductive to happiness than a drug addiction would
be - just while one is addicted, one may believe that it would truly bring
enjoyment, and rationalize the suffering that comes with it.
</psychology>

</rant>

-- Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>




^ permalink raw reply	[flat|nested] 41+ messages in thread
[parent not found: <En96zv.9LA@world.std.com>]

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

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-13  0:00 Distinguishing type names from other identifiers Adam Beneschan
1998-01-14  0:00 ` Brian Rogoff
1998-01-15  0:00   ` Michael F Brenner
1998-01-15  0:00     ` Nick Roberts
1998-01-16  0:00       ` Robert Dewar
1998-01-16  0:00         ` Michael F Brenner
1998-01-16  0:00           ` Robert Dewar
1998-01-16  0:00             ` Robert Dewar
1998-01-16  0:00             ` Brian Rogoff
1998-01-17  0:00               ` nabbasi
1998-01-18  0:00                 ` Robert Dewar
1998-01-18  0:00                   ` who owns the code? was " nabbasi
1998-01-18  0:00                     ` Robert Dewar
1998-01-19  0:00                       ` nabbasi
1998-01-19  0:00                         ` Robert Dewar
1998-01-20  0:00                           ` Paul Van Bellinghen
1998-01-21  0:00                             ` Robert Dewar
1998-01-21  0:00                               ` nabbasi
1998-01-22  0:00                                 ` Robert Dewar
1998-01-22  0:00                                   ` nabbasi
1998-01-21  0:00                               ` nabbasi
1998-01-22  0:00                                 ` Robert Dewar
1998-01-26  0:00                           ` Matthew Heaney
1998-01-20  0:00                       ` Anonymous
1998-01-20  0:00                         ` Robert Dewar
     [not found]               ` <69rnvv$ <dewar.885475174@me>
1998-01-23  0:00                 ` James Hopper
1998-01-23  0:00                 ` James Hopper
1998-01-22  0:00                   ` Robert Dewar
     [not found]                 ` <6a8mir$caa@nn <dewar.8855 <6a8vgd$cr7@nntp1.erinet.com>
1998-01-23  0:00                   ` Richard Kenner
1998-01-23  0:00                   ` Robert Dewar
1998-01-23  0:00                     ` Paul Van Bellinghen
1998-01-23  0:00                       ` Robert Dewar
     [not found]                 ` <6a8mir$caa@nn <dewar.8855 <6a8vgd$cr7@nn <dewar.885555487@merv>
1998-01-24  0:00                   ` James Hopper
1998-01-21  0:00           ` Philip Brashear
1998-01-20  0:00         ` Benoit Jauvin-Girard
1998-01-20  0:00           ` Robert Dewar
1998-01-19  0:00 ` who owns the code? was " Anonymous
1998-01-19  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1998-01-22  0:00 Marc Wachowitz
     [not found] <En96zv.9LA@world.std.com>
1998-02-03  0:00 ` TConiam
1998-02-03  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