comp.lang.ada
 help / color / mirror / Atom feed
* Naming conventions : where does the capital letter come frome ?
@ 2008-09-27  1:52 Hibou57 (Yannick Duchêne)
  2008-09-27  6:03 ` Randy Brukardt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2008-09-27  1:52 UTC (permalink / raw)


Hello and Bonsoir,

I was wondering why the most used Ada naming convention use capital
letters with underscores.... further more, why capital letters while
there are underscores to help to discern identifier parts ?

If one suppose that abc_def is not less readable than Abc_Def, then
why to use capital letters ? Is it for mono-part identifiers ? Ok, abc
will not look like Abc in a context where reserved words are written
in all lower case letters. While in the mean time, reserved word are
commonly clearly discerned, beceause these are well known and most of
nowadays raw text editors use syntax highlighting.

I first though it was to be near of an old common Pascal naming
convention (mainly from Borlan I suppose) like AbcDef... but there was
no underscores with this naming convention, thus the need of capital
letters...

Do some one know more about this story ? I would really enjoy to learn
more about it

Many thanks to all of you here :)

Read you soon



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

* Re: Naming conventions : where does the capital letter come frome ?
  2008-09-27  1:52 Naming conventions : where does the capital letter come frome ? Hibou57 (Yannick Duchêne)
@ 2008-09-27  6:03 ` Randy Brukardt
  2008-09-27 12:43   ` Hibou57 (Yannick Duchêne)
  2008-09-27 19:40 ` Stephen Horne
  2008-09-29 14:51 ` Adam Beneschan
  2 siblings, 1 reply; 5+ messages in thread
From: Randy Brukardt @ 2008-09-27  6:03 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

"Hibou57 (Yannick Duch�ne)" <yannick_duchene@yahoo.fr> wrote in message 
news:40018f14-ff25-4701-8b5b-52c512e5fc99@m44g2000hsc.googlegroups.com...
> Hello and Bonsoir,
>
> I was wondering why the most used Ada naming convention use capital
> letters with underscores.... further more, why capital letters while
> there are underscores to help to discern identifier parts ?

Just speculating, but I think the names of entities are (logically) proper 
names. And you write proper names with a capital letter. After all, I write 
my name Randy Brukardt, not randy brukardt. The underscore just replaces the 
space, it doesn't change the way you'd capitalize the name.

So, similarly, I'd write

    package Claw is
        type Root_Window_Type is ...

not

   package claw is
       type root_window_type is ...


                                       Randy.





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

* Re: Naming conventions : where does the capital letter come frome ?
  2008-09-27  6:03 ` Randy Brukardt
@ 2008-09-27 12:43   ` Hibou57 (Yannick Duchêne)
  0 siblings, 0 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2008-09-27 12:43 UTC (permalink / raw)


On 27 sep, 08:03, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> Just speculating, but I think the names of entities are (logically) proper
> names. And you write proper names with a capital letter. After all, I write
> my name Randy Brukardt, not randy brukardt. The underscore just replaces the
> space, it doesn't change the way you'd capitalize the name.
>
> So, similarly, I'd write
>
>     package Claw is
>         type Root_Window_Type is ...
>
> not
>
>    package claw is
>        type root_window_type is ...
>
>                                        Randy.


I like this reply very much

... It's a lovely view and feel




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

* Re: Naming conventions : where does the capital letter come frome ?
  2008-09-27  1:52 Naming conventions : where does the capital letter come frome ? Hibou57 (Yannick Duchêne)
  2008-09-27  6:03 ` Randy Brukardt
@ 2008-09-27 19:40 ` Stephen Horne
  2008-09-29 14:51 ` Adam Beneschan
  2 siblings, 0 replies; 5+ messages in thread
From: Stephen Horne @ 2008-09-27 19:40 UTC (permalink / raw)


On Fri, 26 Sep 2008 18:52:52 -0700 (PDT), Hibou57 (Yannick Duch�ne)
<yannick_duchene@yahoo.fr> wrote:

>Hello and Bonsoir,
>
>I was wondering why the most used Ada naming convention use capital
>letters with underscores.... further more, why capital letters while
>there are underscores to help to discern identifier parts ?

1.  Why not?
2.  For fast reading, two visual cues are better than one.
3.  To fit in with the crowd ;-)

After all, it doesn't create any clutter. It's just a few capital
letters.

Incidentally, acronyms are one of the reasons why I don't like
theJavaStandardNamingConvention. aTLAInAnIdentifierMakesItConfusing
because the word break isn't immediately obvious. Plus the underscores
serve the same purpose as blank lines - spacing things out a bit.

For capital letters, the reasons probably aren't so strong, and some
people use different case conventions for different kinds of
identifiers. I've seen generic names in all-caps, for example, and
variables in all-lowercase, with mixed case used for functions,
procedures and (IIRC) types.




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

* Re: Naming conventions : where does the capital letter come frome ?
  2008-09-27  1:52 Naming conventions : where does the capital letter come frome ? Hibou57 (Yannick Duchêne)
  2008-09-27  6:03 ` Randy Brukardt
  2008-09-27 19:40 ` Stephen Horne
@ 2008-09-29 14:51 ` Adam Beneschan
  2 siblings, 0 replies; 5+ messages in thread
From: Adam Beneschan @ 2008-09-29 14:51 UTC (permalink / raw)


On Sep 26, 6:52 pm, Hibou57 (Yannick Duchêne)
<yannick_duch...@yahoo.fr> wrote:
> Hello and Bonsoir,
>
> I was wondering why the most used Ada naming convention use capital
> letters with underscores.... further more, why capital letters while
> there are underscores to help to discern identifier parts ?

This isn't an answer to your question, but a historical note: In the
Ada 83 reference manual, the convention was that names of identifiers
were in *all* capitals; reserved words were all lower-case (and were
printed in boldface, in the manual).  I can't say for certain why it
changed, but quite possibly people just felt that having too many
capital letters strung together was harder on the eyes (particularly
in source code, where, without a special tool or editor to view the
code, letters all appear in the same font).

Actually, I'd guess that the reason for the current naming convention
is partly just that many people find it easiest for readability.
*Why* it would be easiest is a really hard question, but it seems like
it would be a fascinating one---for linguists or psycholinguists or
somebody in that field.  Maybe one of them has some ideas about it.
Is there a Usenet linguistics group someone could ask?

                               -- Adam




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

end of thread, other threads:[~2008-09-29 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-27  1:52 Naming conventions : where does the capital letter come frome ? Hibou57 (Yannick Duchêne)
2008-09-27  6:03 ` Randy Brukardt
2008-09-27 12:43   ` Hibou57 (Yannick Duchêne)
2008-09-27 19:40 ` Stephen Horne
2008-09-29 14:51 ` Adam Beneschan

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