comp.lang.ada
 help / color / mirror / Atom feed
* Ada's identifiers casing considered ugly
@ 2012-09-05 19:01 Yannick Duchêne (Hibou57)
  2012-09-05 19:15 ` Vinzent Hoefler
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2012-09-05 19:01 UTC (permalink / raw)


(this topic is for fun)

I was reading the Python's PEP‑8, which I have not read so far, when just  
saw this:

    http://www.python.org/dev/peps/pep-0008/

    > The following naming styles are commonly distinguished:
    > […]
    > Capitalized_Words_With_Underscores (ugly!)

With an exclamation mark, above all.


Just to get back to a more interesting topic, I also had another though  
while reading this PEP: this may help if there was such a precise layout  
convention for Ada as the one there is for Python. But may be the one of  
AdaCore is more widespread than I believe (we already discussed this a bit  
with in old topic about the *_Type convention).


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:01 Ada's identifiers casing considered ugly Yannick Duchêne (Hibou57)
@ 2012-09-05 19:15 ` Vinzent Hoefler
  2012-09-05 19:23 ` Pascal Obry
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Vinzent Hoefler @ 2012-09-05 19:15 UTC (permalink / raw)


Yannick Duchêne (Hibou57) wrote:

> Just to get back to a more interesting topic, I also had another though
> while reading this PEP: this may help if there was such a precise layout
> convention for Ada as the one there is for Python.

What's wrong with the famous "Ada95 Quality & Style: Guidelines for Professional
Programmers"? ;)

> But may be the one of
> AdaCore is more widespread than I believe (we already discussed this a bit
> with in old topic about the *_Type convention).

Well, we do have an ALL_CAPS_FOR_IDENTIFIERS convention (probably stemming from
the fact that the original guidelines were based on the Ada83 LRM), but apart
 from that, it's pretty much the same.


Vinzent.

-- 
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
     -- Nathaniel Borenstein



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:01 Ada's identifiers casing considered ugly Yannick Duchêne (Hibou57)
  2012-09-05 19:15 ` Vinzent Hoefler
@ 2012-09-05 19:23 ` Pascal Obry
  2012-09-05 19:37   ` Vinzent Hoefler
  2012-09-05 23:23 ` Nasser M. Abbasi
  2012-09-07  9:59 ` Stephen Leake
  3 siblings, 1 reply; 12+ messages in thread
From: Pascal Obry @ 2012-09-05 19:23 UTC (permalink / raw)


Le 05/09/2012 21:01, Yannick Duchêne (Hibou57) a écrit :
> (this topic is for fun)
> 
> I was reading the Python's PEP‑8, which I have not read so far, when
> just saw this:
> 
>    http://www.python.org/dev/peps/pep-0008/
> 
>    > The following naming styles are commonly distinguished:
>    > […]
>    > Capitalized_Words_With_Underscores (ugly!)

iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B




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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:23 ` Pascal Obry
@ 2012-09-05 19:37   ` Vinzent Hoefler
  2012-09-05 20:24     ` Shark8
  2012-09-05 21:07     ` Manuel Collado
  0 siblings, 2 replies; 12+ messages in thread
From: Vinzent Hoefler @ 2012-09-05 19:37 UTC (permalink / raw)


Pascal Obry wrote:

> Le 05/09/2012 21:01, Yannick Duchêne (Hibou57) a écrit :
>> (this topic is for fun)
>>
>> I was reading the Python's PEP‑8, which I have not read so far, when
>> just saw this:
>>
>>    http://www.python.org/dev/peps/pep-0008/
>>
>>    > The following naming styles are commonly distinguished:
>>    > […]
>>    > Capitalized_Words_With_Underscores (ugly!)
>
> iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords.

AndItSureDoesNotLookSoUgly.


Vinzent.

-- 
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
     -- Nathaniel Borenstein



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:37   ` Vinzent Hoefler
@ 2012-09-05 20:24     ` Shark8
  2012-09-05 22:58       ` Anh Vo
  2012-09-05 21:07     ` Manuel Collado
  1 sibling, 1 reply; 12+ messages in thread
From: Shark8 @ 2012-09-05 20:24 UTC (permalink / raw)


On Wednesday, September 5, 2012 1:37:40 PM UTC-6, Vinzent Hoefler wrote:
> Pascal Obry wrote:
> > Le 05/09/2012 21:01, Yannick Duchêne (Hibou57) a écrit :
> >> (this topic is for fun)
> >>
> >> I was reading the Python's PEP-8, which I have not read so far, when
> >> just saw this:
> >>
> >>    http://www.python.org/dev/peps/pep-0008/
> >>
> >>    > The following naming styles are commonly distinguished:
> >>    > [...]
> >>    > Capitalized_Words_With_Underscores (ugly!)
> >
> > iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords.
> 
> AndItSureDoesNotLookSoUgly.

Also great with embedded acronym/initialisms.
WriteNASAComplaint, ReadTWAINDevice, EmptyFIFOContainer.



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:37   ` Vinzent Hoefler
  2012-09-05 20:24     ` Shark8
@ 2012-09-05 21:07     ` Manuel Collado
  2012-09-05 21:40       ` Vinzent Hoefler
  1 sibling, 1 reply; 12+ messages in thread
From: Manuel Collado @ 2012-09-05 21:07 UTC (permalink / raw)


El 05/09/2012 21:37, Vinzent Hoefler escribió:
> Pascal Obry wrote:
>
>> Le 05/09/2012 21:01, Yannick Duchêne (Hibou57) a écrit :
>>> (this topic is for fun)
>>>
>>> I was reading the Python's PEP‑8, which I have not read so far, when
>>> just saw this:
>>>
>>>    http://www.python.org/dev/peps/pep-0008/
>>>
>>>    > The following naming styles are commonly distinguished:
>>>    > […]
>>>    > Capitalized_Words_With_Underscores (ugly!)
>>
>> iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords.
>
> AndItSureDoesNotLookSoUgly.

Ada code is case insensitive. So a code reformatter can safely change 
the case of identifiers to a normalized form, in order to avoid variants 
of the same identifier inside a set of source files. If there are no 
underscores to delimit components of a composed identifier, then they 
can/should be merged in a single word. Underscores as separators ensure 
that the composed name remains a composed one.

After that, capitalization of individual components of a composed 
identifier remains a matter of taste. Some people will find it easier to 
read (w.r.t. all lowercase or uppercase).

Just my 2c.
-- 
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado






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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 21:07     ` Manuel Collado
@ 2012-09-05 21:40       ` Vinzent Hoefler
  0 siblings, 0 replies; 12+ messages in thread
From: Vinzent Hoefler @ 2012-09-05 21:40 UTC (permalink / raw)


Manuel Collado wrote:

> El 05/09/2012 21:37, Vinzent Hoefler escribió:
>> Pascal Obry wrote:
>>
>>> Le 05/09/2012 21:01, Yannick Duchêne (Hibou57) a écrit :
>>>> (this topic is for fun)
>>>>
>>>> I was reading the Python's PEP‑8, which I have not read so far, when
>>>> just saw this:
>>>>
>>>>    http://www.python.org/dev/peps/pep-0008/
>>>>
>>>>    > The following naming styles are commonly distinguished:
>>>>    > […]
>>>>    > Capitalized_Words_With_Underscores (ugly!)
>>>
>>> iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords.
>>
>> AndItSureDoesNotLookSoUgly.
>
> Ada code is case insensitive. [...]

Preaching to the choir? ;)


Vinzent.

-- 
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
     -- Nathaniel Borenstein



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 20:24     ` Shark8
@ 2012-09-05 22:58       ` Anh Vo
  2012-09-06 10:02         ` Georg Bauhaus
  0 siblings, 1 reply; 12+ messages in thread
From: Anh Vo @ 2012-09-05 22:58 UTC (permalink / raw)


On Wednesday, September 5, 2012 1:24:37 PM UTC-7, Shark8 wrote:
> On Wednesday, September 5, 2012 1:37:40 PM UTC-6, Vinzent Hoefler wrote: > Pascal Obry wrote: > > Le 05/09/2012 21:01, Yannick Duchêne (Hibou57) a écrit : > >> (this topic is for fun) > >> > >> I was reading the Python's PEP-8, which I have not read so far, when > >> just saw this: > >> > >> http://www.python.org/dev/peps/pep-0008/ > >> > >> > The following naming styles are commonly distinguished: > >> > [...] > >> > Capitalized_Words_With_Underscores (ugly!) > > > > iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords. > > AndItSureDoesNotLookSoUgly. Also great with embedded acronym/initialisms. WriteNASAComplaint, ReadTWAINDevice, EmptyFIFOContainer.

I agree with Pascal. I am also glad that this style is not used drug prescription. Otherwise, drug prescription malpractice will no doubt contribute to medical cost. Unfortunately, all us has to pay :-(



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:01 Ada's identifiers casing considered ugly Yannick Duchêne (Hibou57)
  2012-09-05 19:15 ` Vinzent Hoefler
  2012-09-05 19:23 ` Pascal Obry
@ 2012-09-05 23:23 ` Nasser M. Abbasi
  2012-10-16 23:07   ` Randy Brukardt
  2012-09-07  9:59 ` Stephen Leake
  3 siblings, 1 reply; 12+ messages in thread
From: Nasser M. Abbasi @ 2012-09-05 23:23 UTC (permalink / raw)


On 9/5/2012 2:01 PM, Yannick Duchêne (Hibou57) wrote:
> (this topic is for fun)
>
> I was reading the Python's PEP‑8, which I have not read so far, when just
> saw this:
>
>      http://www.python.org/dev/peps/pep-0008/
>
>      > The following naming styles are commonly distinguished:
>      > […]
>      > Capitalized_Words_With_Underscores (ugly!)
>
> With an exclamation mark, above all.
>
>

I agree it is ugly. I said this same thing myself many times.

see one example

http://coding.derkeiler.com/Archive/Ada/comp.lang.ada/2012-08/msg00219.html

"I like underscore in names of variables. But I do not like
at all the current Ada tradition of using Upper case for
first letter as in

        This_Is_An_Identifier

I find this ugly and hard on the eye to read. I like
all lower case for variable names, as it is easier to read. Less
variation in texture and form

this_is_an_identifier"

So, I am not the only one then who thinks this Ada naming style
is ugly ;)

--Nasser



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 22:58       ` Anh Vo
@ 2012-09-06 10:02         ` Georg Bauhaus
  0 siblings, 0 replies; 12+ messages in thread
From: Georg Bauhaus @ 2012-09-06 10:02 UTC (permalink / raw)


On 06.09.12 00:58, Anh Vo wrote:
> On Wednesday, September 5, 2012 1:24:37 PM UTC-7, Shark8 wrote:
>> On Wednesday, September 5, 2012 1:37:40 PM UTC-6, Vinzent Hoefler wrote: > Pascal Obry wrote: > > Le 05/09/2012 21:01, Yannick Duch�ne (Hibou57) a �crit : > >> (this topic is for fun) > >> > >> I was reading the Python's PEP-8, which I have not read so far, when > >> just saw this: > >> > >> http://www.python.org/dev/peps/pep-0008/ > >> > >> > The following naming styles are commonly distinguished: > >> > [...] > >> > Capitalized_Words_With_Underscores (ugly!) > > > > iunderstandthemasitisreallyhardtoreadatextwithunderscoresseparatingwords. > > AndItSureDoesNotLookSoUgly. Also great with embedded acronym/initialisms. WriteNASAComplaint, ReadTWAINDevice, EmptyFIFOContainer.


G>oo>>gle>>>is a> >high>>>>tech>>>>company.
"We don't have better algorithms.  We just have more data."

Oh, well.

Quote attributed to Prof. Peter Norvig, who working at Google.
The reference is reportedly available at IEEE, in
http://doi.ieeecomputersociety.org/10.1109/MIS.2009.36
for for USD 19.--.






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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 19:01 Ada's identifiers casing considered ugly Yannick Duchêne (Hibou57)
                   ` (2 preceding siblings ...)
  2012-09-05 23:23 ` Nasser M. Abbasi
@ 2012-09-07  9:59 ` Stephen Leake
  3 siblings, 0 replies; 12+ messages in thread
From: Stephen Leake @ 2012-09-07  9:59 UTC (permalink / raw)


"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> (this topic is for fun)
>
> I was reading the Python's PEP‑8, which I have not read so far, when
> just saw this:
>
>    http://www.python.org/dev/peps/pep-0008/
>
>    > The following naming styles are commonly distinguished:
>    > […]
>    > Capitalized_Words_With_Underscores (ugly!)
>
> With an exclamation mark, above all.
>
>
> Just to get back to a more interesting topic, I also had another
> though while reading this PEP: this may help if there was such a
> precise layout convention for Ada as the one there is for Python. 

There is; the one enforced by Emacs Ada mode indentation engine with
default options :).

-- 
-- Stephe



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

* Re: Ada's identifiers casing considered ugly
  2012-09-05 23:23 ` Nasser M. Abbasi
@ 2012-10-16 23:07   ` Randy Brukardt
  0 siblings, 0 replies; 12+ messages in thread
From: Randy Brukardt @ 2012-10-16 23:07 UTC (permalink / raw)


"Nasser M. Abbasi" <nma@12000.org> wrote in message 
news:k28mt2$jnj$1@speranza.aioe.org...
...
> "I like underscore in names of variables. But I do not like
> at all the current Ada tradition of using Upper case for
> first letter as in
>
>        This_Is_An_Identifier
>
> I find this ugly and hard on the eye to read.

I agree with this.

> ... I like
> all lower case for variable names, as it is easier to read. Less
> variation in texture and form
>
> this_is_an_identifier"

But I don't agree with this. This blends identifiers and reserved words into 
an unreadable mess. (Maybe it's OK if you ONLY use colorizing editors and 
never expect anyone else to use your code.)

RRS uses "title case" for identifiers, which means that we use the same 
casing as you would if you wrote this as the title of something. For the 
above, that gives:

   This_is_an_Identifier

Our pretty printer can enforce this style directly (it has a list of words 
that aren't capitalized).

I've also experimented with capitalizing just the first letter:

   This_is_an_identifier

I definitely agree that capitalizing words like "Is" is ugly. I get in 
trouble repeatedly working on the Ada Standard, because I naturally refuse 
to type "_Is_" and thus a lot of identifiers end up in the "wrong" case.

                                          Randy.






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

end of thread, other threads:[~2012-10-16 23:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 19:01 Ada's identifiers casing considered ugly Yannick Duchêne (Hibou57)
2012-09-05 19:15 ` Vinzent Hoefler
2012-09-05 19:23 ` Pascal Obry
2012-09-05 19:37   ` Vinzent Hoefler
2012-09-05 20:24     ` Shark8
2012-09-05 22:58       ` Anh Vo
2012-09-06 10:02         ` Georg Bauhaus
2012-09-05 21:07     ` Manuel Collado
2012-09-05 21:40       ` Vinzent Hoefler
2012-09-05 23:23 ` Nasser M. Abbasi
2012-10-16 23:07   ` Randy Brukardt
2012-09-07  9:59 ` Stephen Leake

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