comp.lang.ada
 help / color / mirror / Atom feed
* On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
@ 2013-01-04  4:27 Rod Kay
  2013-01-04  4:32 ` Rod Kay
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Rod Kay @ 2013-01-04  4:27 UTC (permalink / raw)


Hi folks,

   I've been trialling this style and come to like it. An example would be ...


   declare
      package Integer_Vectors is new Ada.Containers.Vectors (Positive, Integer);
      
      Integers : Integer_Vectors.Vector;
   begin
      Integers.reserve_Capacity;
      Integers.clear;
   end;


   The idea is to only capitalise the noun parts of the procedure name. It's a minor thing I guess, yet I find code a little easier to read when used.

   On the other hand, the half dozen Ada people I've discussed the style with have been dubious at best.

   So any thoughts ? ... good, bad or ugly ?


regards.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04  4:27 On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Rod Kay
@ 2013-01-04  4:32 ` Rod Kay
  2013-01-05  1:30   ` Robert A Duff
  2013-01-04 16:31 ` Adam Beneschan
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 30+ messages in thread
From: Rod Kay @ 2013-01-04  4:32 UTC (permalink / raw)


Hmm, of course, it should have been ...
 
       Integers.reserve_Capacity (100);


(Why do I always spot these things just after hitting 'post' ... :)



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04  4:27 On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Rod Kay
  2013-01-04  4:32 ` Rod Kay
@ 2013-01-04 16:31 ` Adam Beneschan
  2013-01-04 16:52   ` AdaMagica
  2013-01-05  3:33   ` Rod Kay
  2013-01-04 18:32 ` Simon Wright
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 30+ messages in thread
From: Adam Beneschan @ 2013-01-04 16:31 UTC (permalink / raw)


On Thursday, January 3, 2013 8:27:42 PM UTC-8, Rod Kay wrote:
> Hi folks,
> 
>    I've been trialling this style and come to like it. An example would be ...

>    declare
>       package Integer_Vectors is new Ada.Containers.Vectors (Positive, Integer);
> 
>       Integers : Integer_Vectors.Vector;
>    begin
>       Integers.reserve_Capacity;
>       Integers.clear;
>    end;
> 
>    The idea is to only capitalise the noun parts of the procedure name. It's a minor thing I guess, yet I find code a little easier to read when used.

That would make sense if German is your first language, I suppose.  To me, whose main language is (American) English, it just looks a little weird, aesthetically.  But I don't find it either easier or more difficult to read either way.

Just my 2 Pfennig,

                             -- Adam



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04 16:31 ` Adam Beneschan
@ 2013-01-04 16:52   ` AdaMagica
  2013-01-05  3:41     ` Rod Kay
  2013-01-05  3:33   ` Rod Kay
  1 sibling, 1 reply; 30+ messages in thread
From: AdaMagica @ 2013-01-04 16:52 UTC (permalink / raw)


Wenn ich auch meinen Senf dazugeben darf:

I use lower case for small verbs or prepositions like:

is_Empty, has_Item, Member_of_Something



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04  4:27 On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Rod Kay
  2013-01-04  4:32 ` Rod Kay
  2013-01-04 16:31 ` Adam Beneschan
@ 2013-01-04 18:32 ` Simon Wright
  2013-01-05  3:47   ` Rod Kay
  2013-01-05 14:11   ` Stephen Leake
  2013-01-05 14:06 ` On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Stephen Leake
  2013-01-11 16:47 ` Martin
  4 siblings, 2 replies; 30+ messages in thread
From: Simon Wright @ 2013-01-04 18:32 UTC (permalink / raw)


Rod Kay <rodakay@internode.on.net> writes:

>    declare
>       package Integer_Vectors is new Ada.Containers.Vectors (Positive, Integer);
>       
>       Integers : Integer_Vectors.Vector;
>    begin
>       Integers.reserve_Capacity;
>       Integers.clear;
>    end;
>
>
> The idea is to only capitalise the noun parts of the procedure
> name. It's a minor thing I guess, yet I find code a little easier to
> read when used.

I like my IDE (Emacs) to capitalise for me, and this would need so many
case exceptions that it'd become impractical.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04  4:32 ` Rod Kay
@ 2013-01-05  1:30   ` Robert A Duff
  2013-01-05  3:58     ` Rod Kay
                       ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Robert A Duff @ 2013-01-05  1:30 UTC (permalink / raw)


Rod Kay <rodakay@internode.on.net> writes:

> Hmm, of course, it should have been ...
>  
>        Integers.reserve_Capacity (100);
>
>
> (Why do I always spot these things just after hitting 'post' ... :)

Hitting the "send" key gives one all sorts of magical enlightenment. ;-)

As to whether your "reserve_Capacity" style is good or bad:
It's not what everyone else does, so it's not a good idea.
I suggest you save your creativity for higher-level stuff, like
interesting algorithms and abstractions.  For low-level stuff
like indentation and casing, just blindly do what everybody else does.
That makes the code more readable for everybody.

- Bob



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04 16:31 ` Adam Beneschan
  2013-01-04 16:52   ` AdaMagica
@ 2013-01-05  3:33   ` Rod Kay
  2013-01-05  4:19     ` Britt
  2013-01-05  5:18     ` Randy Brukardt
  1 sibling, 2 replies; 30+ messages in thread
From: Rod Kay @ 2013-01-05  3:33 UTC (permalink / raw)


On Saturday, 5 January 2013 03:31:09 UTC+11, Adam Beneschan  wrote:

> >    The idea is to only capitalise the noun parts of the procedure name. It's a minor thing I guess, yet I find code a little easier to read when used.
> 
> 
> 
> That would make sense if German is your first language, I suppose.  To me, whose main language is (American) English, it just looks a little weird, aesthetically.  But I don't find it either easier or more difficult to read either way.


   English is my 1st language, also :). 

   It occurred to me that verbs are never capitalised in English (except as the leading word in a sentence, of course). Proper nouns (and at one time normal nouns) are capitalised. I guess I find it slightly easier to read as it resembles normal English sentences a little more.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04 16:52   ` AdaMagica
@ 2013-01-05  3:41     ` Rod Kay
  2013-01-11  8:01       ` John English
  0 siblings, 1 reply; 30+ messages in thread
From: Rod Kay @ 2013-01-05  3:41 UTC (permalink / raw)


On Saturday, 5 January 2013 03:52:43 UTC+11, AdaMagica  wrote:
> 
> I use lower case for small verbs or prepositions like:
> 
> is_Empty, has_Item, Member_of_Something


   Yes, in fact, I also do this :).



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04 18:32 ` Simon Wright
@ 2013-01-05  3:47   ` Rod Kay
  2013-01-05 14:11   ` Stephen Leake
  1 sibling, 0 replies; 30+ messages in thread
From: Rod Kay @ 2013-01-05  3:47 UTC (permalink / raw)


On Saturday, 5 January 2013 05:32:56 UTC+11, Simon Wright  wrote:
> 
> I like my IDE (Emacs) to capitalise for me, and this would need so many
> case exceptions that it'd become impractical.


   I have a similar trouble with GPS identifier completion, tho only with standard Ada and 'external/contributed' packages.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  1:30   ` Robert A Duff
@ 2013-01-05  3:58     ` Rod Kay
  2013-01-05 12:37       ` Simon Clubley
  2013-01-05  5:13     ` Randy Brukardt
  2013-01-05 19:17     ` Georg Bauhaus
  2 siblings, 1 reply; 30+ messages in thread
From: Rod Kay @ 2013-01-05  3:58 UTC (permalink / raw)


On Saturday, 5 January 2013 12:30:20 UTC+11, Robert A Duff  wrote:
> 
> Hitting the "send" key gives one all sorts of magical enlightenment. ;-)


   Lol ... yes, indeed. A pity posts cannot be edited.

 
 
> 
> As to whether your "reserve_Capacity" style is good or bad:
> It's not what everyone else does, so it's not a good idea.


   Breaking with convention has been the main criticism I've received from others so far. I agree it's definitely a 'con'. 



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  3:33   ` Rod Kay
@ 2013-01-05  4:19     ` Britt
  2013-01-05  5:24       ` Randy Brukardt
  2013-01-05  5:18     ` Randy Brukardt
  1 sibling, 1 reply; 30+ messages in thread
From: Britt @ 2013-01-05  4:19 UTC (permalink / raw)


On Friday, January 4, 2013 10:33:02 PM UTC-5, Rod Kay wrote:
> On Saturday, 5 January 2013 03:31:09 UTC+11, Adam Beneschan  wrote:
> 
> 
> 
> > >    The idea is to only capitalize the noun parts of the procedure name. It's a minor thing I guess, yet I find code a little easier to read when used.
> 
> > 
> 
> > 
> 
> > 
> 
> > That would make sense if German is your first language, I suppose.  To me, whose main language is (American) English, it just looks a little weird, aesthetically.  But I don't find it either easier or more difficult to read either way.
> 
> 
> 
> 
> 
>    English is my 1st language, also :). 
> 
> 
> 
>    It occurred to me that verbs are never capitalized in English (except as the leading word in a sentence, of course). Proper nouns (and at one time normal nouns) are capitalized. I guess I find it slightly easier to read as it resembles normal English sentences a little more.

I agree with Bob Duff's reply. I think anything starting with lowercase (other than keywords) looks weird and would distract me.  The common Ada convention is to capitalize first letters and each letter immediately following an underscore.  I also prefer to capitalize the first letter of attributes as in 'Pos. Acronyms should be all caps.

Your proposal would be awkward for most pretty printers like to handle but I think gnatpp could support it using its default "as declared" casing mode. Gnatpp also supports casing exception dictionaries.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  1:30   ` Robert A Duff
  2013-01-05  3:58     ` Rod Kay
@ 2013-01-05  5:13     ` Randy Brukardt
  2013-01-06  5:26       ` Rod Kay
  2013-01-05 19:17     ` Georg Bauhaus
  2 siblings, 1 reply; 30+ messages in thread
From: Randy Brukardt @ 2013-01-05  5:13 UTC (permalink / raw)


"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
news:wccvcbca02b.fsf@shell01.TheWorld.com...
...
> As to whether your "reserve_Capacity" style is good or bad:
> It's not what everyone else does, so it's not a good idea.
> I suggest you save your creativity for higher-level stuff, like
> interesting algorithms and abstractions.  For low-level stuff
> like indentation and casing, just blindly do what everybody else does.
> That makes the code more readable for everybody.

That makes sense, other than "what everybody else does" is not well-defined. 
There still seems to be a lot of code in the Ada 83 style around, just to 
take one example.

At RR Software, our style guide recommends using "Title Case" for 
identifiers. That is, capitalize an identifier the same way as you would a 
title. (Our pretty printer will automatically use this style if requested.)

For instance, taking some examples from one of the AI tools:

    procedure Put_AI_Header_and_Subject (Fyle : in Ada.Text_IO.File_Type;
                                                                    Issue : 
in AI_Types.AI_Identifier) is
        -- Put a line containing an AI identifier, version,
        -- last modification date, and subject to Fyle.

   procedure Records_of_Response (TXT_Name, RTF_Name, HTML_Name : in 
String);
       -- Create the record of response document from the data stored in
       -- AI_Data.AI_Database and the original AI files.

I'm forever getting in trouble with people like Bob when I write identifiers 
in this style in the Ada Standard. :-) To me, capitalizing "_And_" and 
"_Of_" is ugly. (It should be noted, this was not originally my idea, it 
took a lot of convincing originally.)

I think the best advice is to use whatever typographical style that makes 
sense in your organization. But try to make sure that everyone that works on 
a project uses the same style! It's that consistency that counts most, not 
the details.

                                              Randy.







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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  3:33   ` Rod Kay
  2013-01-05  4:19     ` Britt
@ 2013-01-05  5:18     ` Randy Brukardt
  1 sibling, 0 replies; 30+ messages in thread
From: Randy Brukardt @ 2013-01-05  5:18 UTC (permalink / raw)


"Rod Kay" <rodakay@internode.on.net> wrote in message 
news:715b71c7-e606-4597-a29b-0e0fef58b4d1@googlegroups.com...
> It occurred to me that verbs are never capitalised in English (except as 
> the leading word
> in a sentence, of course). Proper nouns (and at one time normal nouns) are 
> capitalised.
> I guess I find it slightly easier to read as it resembles normal English 
> sentences a little more.

This would make sense to me, but only if you capitalized the first letter of 
every Identifier. This to me is like starting a sentence or title (RRS 
thinks of identifiers as titles), and the first letter is always 
capitalized. Thus,
     Is_Valid and Window_is_Valid
Certainly, I'd never think that something like
     reserve_Capacity
is correct. But I could see a style where a verb in the middle was in lower 
case.

                                Randy.





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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  4:19     ` Britt
@ 2013-01-05  5:24       ` Randy Brukardt
  0 siblings, 0 replies; 30+ messages in thread
From: Randy Brukardt @ 2013-01-05  5:24 UTC (permalink / raw)


"Britt" <britt.snodgrass@gmail.com> wrote in message 
news:aa848e11-e03e-4dcb-be65-300899399d32@googlegroups.com...
...
>Your proposal would be awkward for most pretty printers like to handle but 
>I think
>gnatpp could support it using its default "as declared" casing mode. Gnatpp 
>also
>supports casing exception dictionaries.

True, but Title Case is easy (the number of exceptions is very small, I 
think there are twenty words in the Janus/Ada pretty printer's list). And 
it's what you'd write in text: you'd write "Records of Response", never 
"Records Of Response".

As with all such things, there can be no resolution to such an argument. 
Just don't ever start an identifier with a lower case letter, that's just 
too weird. :-)

                                        Randy. 





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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  3:58     ` Rod Kay
@ 2013-01-05 12:37       ` Simon Clubley
  2013-01-06  5:29         ` Rod Kay
  0 siblings, 1 reply; 30+ messages in thread
From: Simon Clubley @ 2013-01-05 12:37 UTC (permalink / raw)


On 2013-01-04, Rod Kay <rodakay@internode.on.net> wrote:
> On Saturday, 5 January 2013 12:30:20 UTC+11, Robert A Duff  wrote:
>> 
>> Hitting the "send" key gives one all sorts of magical enlightenment. ;-)
>
>
>    Lol ... yes, indeed. A pity posts cannot be edited.
>

The way you do this with a normal Usenet client is to use the Supersedes:
header, usually by having your client generate it for you. This worked just
fine with slrn the last time I needed to do this.

Simon.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04  4:27 On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Rod Kay
                   ` (2 preceding siblings ...)
  2013-01-04 18:32 ` Simon Wright
@ 2013-01-05 14:06 ` Stephen Leake
  2013-01-06  5:37   ` Rod Kay
  2013-01-11 16:47 ` Martin
  4 siblings, 1 reply; 30+ messages in thread
From: Stephen Leake @ 2013-01-05 14:06 UTC (permalink / raw)


Rod Kay <rodakay@internode.on.net> writes:

>    declare
>       package Integer_Vectors is new Ada.Containers.Vectors (Positive, Integer);
>       
>       Integers : Integer_Vectors.Vector;
>    begin
>       Integers.reserve_Capacity;
>       Integers.clear;
>    end;
>
>
>    The idea is to only capitalise the noun parts of the procedure
>    name. It's a minor thing I guess, yet I find code a little easier
>    to read when used.
>
>    So any thoughts ? ... good, bad or ugly ?

If you can teach Emacs and/or GPS to do this automatically, it might be
useful. (It would be a big job; you'd need a good dictionary or
something similar).

Otherwise, it's a non-starter; it's too small an issue to spend
time/brain power on.

-- 
-- Stephe



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04 18:32 ` Simon Wright
  2013-01-05  3:47   ` Rod Kay
@ 2013-01-05 14:11   ` Stephen Leake
  2013-01-05 18:19     ` Simon Wright
  1 sibling, 1 reply; 30+ messages in thread
From: Stephen Leake @ 2013-01-05 14:11 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Rod Kay <rodakay@internode.on.net> writes:
>
>>    declare
>>       package Integer_Vectors is new Ada.Containers.Vectors (Positive, Integer);
>>       
>>       Integers : Integer_Vectors.Vector;
>>    begin
>>       Integers.reserve_Capacity;
>>       Integers.clear;
>>    end;
>>
>>
>> The idea is to only capitalise the noun parts of the procedure
>> name. It's a minor thing I guess, yet I find code a little easier to
>> read when used.
>
> I like my IDE (Emacs) to capitalise for me, and this would need so many
> case exceptions that it'd become impractical.

Unless you add a dictionary of verbs/nouns. Maybe automated lookup into
the on-line OED - do they have an API? A lot of work for very little
gain! But it would be cool if it worked :)

Which reminds me; we need a simpler keybinding for "make this word a
case exception".

-- 
-- Stephe



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05 14:11   ` Stephen Leake
@ 2013-01-05 18:19     ` Simon Wright
  2013-01-09  8:21       ` ada-mode create case exception Stephen Leake
  0 siblings, 1 reply; 30+ messages in thread
From: Simon Wright @ 2013-01-05 18:19 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Simon Wright <simon@pushface.org> writes:
>
>> Rod Kay <rodakay@internode.on.net> writes:
>>
>>> The idea is to only capitalise the noun parts of the procedure
>>> name. It's a minor thing I guess, yet I find code a little easier to
>>> read when used.
>>
>> I like my IDE (Emacs) to capitalise for me, and this would need so
>> many case exceptions that it'd become impractical.
>
> Unless you add a dictionary of verbs/nouns. Maybe automated lookup
> into the on-line OED - do they have an API? A lot of work for very
> little gain! But it would be cool if it worked :)

:-)

> Which reminds me; we need a simpler keybinding for "make this word a
> case exception".

C-c C-y is simple enough. I agree that C-c C-M-y is a bit complex
(though inherited from 4.01): perhaps C-c M-y ?



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  1:30   ` Robert A Duff
  2013-01-05  3:58     ` Rod Kay
  2013-01-05  5:13     ` Randy Brukardt
@ 2013-01-05 19:17     ` Georg Bauhaus
  2 siblings, 0 replies; 30+ messages in thread
From: Georg Bauhaus @ 2013-01-05 19:17 UTC (permalink / raw)


Robert A Duff <bobduff@shell01.TheWorld.com> wrote:

> As to whether your "reserve_Capacity" style is good or bad:
> It's not what everyone else does, so it's not a good idea.

As a programmer, I wish there was a "formal case" that
would draw attention to the fact that we are writing 
source code, which is neither prose nor bits, but is
readable if you are a programmer.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  5:13     ` Randy Brukardt
@ 2013-01-06  5:26       ` Rod Kay
  2013-01-06 22:03         ` Britt
  0 siblings, 1 reply; 30+ messages in thread
From: Rod Kay @ 2013-01-06  5:26 UTC (permalink / raw)


On Saturday, 5 January 2013 16:13:41 UTC+11, Randy Brukardt  wrote:
> 
> At RR Software, our style guide recommends using "Title Case" for 
> identifiers. That is, capitalize an identifier the same way as you would a 
> title. (Our pretty printer will automatically use this style if requested.)
> 

   Title-case seems an improvement to me. Combined with the 'lower-verb' style, the example would become ...

   procedure put_AI_Header_and_Subject (Fyle : in Ada.Text_IO.File_Type;
                                       ...

... which looks more natural, to my eye at least.



> 
> I'm forever getting in trouble with people like Bob when I write identifiers 
> in this style ... 

   Heh, as am I when people, unfamiliar with the style, first see my code.

 
> 
> I think the best advice is to use whatever typographical style that makes 
> sense in your organization. But try to make sure that everyone that works on 
> a project uses the same style! It's that consistency that counts most, not 
> the details.
> 

   Good advice.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05 12:37       ` Simon Clubley
@ 2013-01-06  5:29         ` Rod Kay
  0 siblings, 0 replies; 30+ messages in thread
From: Rod Kay @ 2013-01-06  5:29 UTC (permalink / raw)


On Saturday, 5 January 2013 23:37:23 UTC+11, Simon Clubley  wrote:
> 
> >    Lol ... yes, indeed. A pity posts cannot be edited.
> 
> 
> The way you do this with a normal Usenet client is to use the Supersedes:
> header, usually by having your client generate it for you. This worked just
> fine with slrn the last time I needed to do this.
> 

   Ah, right. Thanks for the tip.



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05 14:06 ` On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Stephen Leake
@ 2013-01-06  5:37   ` Rod Kay
  0 siblings, 0 replies; 30+ messages in thread
From: Rod Kay @ 2013-01-06  5:37 UTC (permalink / raw)


On Sunday, 6 January 2013 01:06:47 UTC+11, Stephen Leake  wrote:
> 
> If you can teach Emacs and/or GPS to do this automatically, it might be
> useful. (It would be a big job; you'd need a good dictionary or
> something similar).
> 
> Otherwise, it's a non-starter; it's too small an issue to spend
> time/brain power on.
> 

   Yes, I doubt if automating the style would be worth the effort (other than using the casing exception methods already mentioned). There is also the problem of distinguishing between words which can be either a verb or a noun (ie 'set').



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-06  5:26       ` Rod Kay
@ 2013-01-06 22:03         ` Britt
  0 siblings, 0 replies; 30+ messages in thread
From: Britt @ 2013-01-06 22:03 UTC (permalink / raw)


On Sunday, January 6, 2013 12:26:12 AM UTC-5, Rod Kay wrote:
 
>    Title-case seems an improvement to me. Combined with the 'lower-verb' style, the example would become ...
> 
>    procedure put_AI_Header_and_Subject (Fyle : in Ada.Text_IO.File_Type;
> 
> ... which looks more natural, to my eye at least.


After thinking about why your proposal looks bad to me I realized that I always regard the name of a subprogram as a singular proper noun (rather than a sentence in itself) because it is used in the source code as a proper name. E.g.

  procedure Run_Very_Quickly (Direction : in Direction_Type) is ...

and, at the point of use:

  Run_Very_Quickly (Direction => North_By_Northwest);

it is the _name_ of the procedure and should be capitalized as a name (proper noun).



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

* Re: ada-mode create case exception
  2013-01-05 18:19     ` Simon Wright
@ 2013-01-09  8:21       ` Stephen Leake
  2013-01-11 16:16         ` Simon Wright
  0 siblings, 1 reply; 30+ messages in thread
From: Stephen Leake @ 2013-01-09  8:21 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> Which reminds me; we need a simpler keybinding for "make this word a
>> case exception".
>
> C-c C-y is simple enough. I agree that C-c C-M-y is a bit complex
> (though inherited from 4.01): perhaps C-c M-y ?

My problem with 4.01 is that you have to manually select the word; the
system is smart enough to do that for you.

-- 
-- Stephe



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-05  3:41     ` Rod Kay
@ 2013-01-11  8:01       ` John English
  2013-01-11 16:48         ` Martin
  0 siblings, 1 reply; 30+ messages in thread
From: John English @ 2013-01-11  8:01 UTC (permalink / raw)


On Saturday, January 5, 2013 5:41:43 AM UTC+2, Rod Kay wrote:
> On Saturday, 5 January 2013 03:52:43 UTC+11, AdaMagica  wrote:
> > I use lower case for small verbs or prepositions like:
> > is_Empty, has_Item, Member_of_Something
> 
>    Yes, in fact, I also do this :).

So perhaps you should ask yourself these questions:

 Is_It_Easier_To_Read?
 Will_Autoformatting_Still_Work?

and then decide to either do_It or Avoid_It... :-)



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

* Re: ada-mode create case exception
  2013-01-09  8:21       ` ada-mode create case exception Stephen Leake
@ 2013-01-11 16:16         ` Simon Wright
  2013-01-13 23:13           ` Stephen Leake
  0 siblings, 1 reply; 30+ messages in thread
From: Simon Wright @ 2013-01-11 16:16 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Simon Wright <simon@pushface.org> writes:
>
>> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>>
>>> Which reminds me; we need a simpler keybinding for "make this word a
>>> case exception".
>>
>> C-c C-y is simple enough. I agree that C-c C-M-y is a bit complex
>> (though inherited from 4.01): perhaps C-c M-y ?
>
> My problem with 4.01 is that you have to manually select the word; the
> system is smart enough to do that for you.

Here, using 4.01 with your patch of 21 March 10 and Georg's patch of 3
September 11, neither of which appear to touch this aspect, I don't have
to select the word. I put point inside the Line of Put_Line; C-c C-M-y
added *Line, C-c C-y added Put_Line.



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

* On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-04  4:27 On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Rod Kay
                   ` (3 preceding siblings ...)
  2013-01-05 14:06 ` On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Stephen Leake
@ 2013-01-11 16:47 ` Martin
  4 siblings, 0 replies; 30+ messages in thread
From: Martin @ 2013-01-11 16:47 UTC (permalink / raw)


-1 sorry!



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-11  8:01       ` John English
@ 2013-01-11 16:48         ` Martin
  2013-01-11 19:26           ` Simon Wright
  0 siblings, 1 reply; 30+ messages in thread
From: Martin @ 2013-01-11 16:48 UTC (permalink / raw)


Is that John "JEWL" English? If so, great to see you back in the Ada world!

-- Martin



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

* Re: On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ?
  2013-01-11 16:48         ` Martin
@ 2013-01-11 19:26           ` Simon Wright
  0 siblings, 0 replies; 30+ messages in thread
From: Simon Wright @ 2013-01-11 19:26 UTC (permalink / raw)


Martin <martin@thedowies.com> writes:

> Is that John "JEWL" English? If so, great to see you back in the Ada world!

Seconded!



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

* Re: ada-mode create case exception
  2013-01-11 16:16         ` Simon Wright
@ 2013-01-13 23:13           ` Stephen Leake
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Leake @ 2013-01-13 23:13 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> Simon Wright <simon@pushface.org> writes:
>>
>>> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>>>
>>>> Which reminds me; we need a simpler keybinding for "make this word a
>>>> case exception".
>>>
>>> C-c C-y is simple enough. I agree that C-c C-M-y is a bit complex
>>> (though inherited from 4.01): perhaps C-c M-y ?
>>
>> My problem with 4.01 is that you have to manually select the word; the
>> system is smart enough to do that for you.
>
> Here, using 4.01 with your patch of 21 March 10 and Georg's patch of 3
> September 11, neither of which appear to touch this aspect, I don't have
> to select the word. I put point inside the Line of Put_Line; C-c C-M-y
> added *Line, C-c C-y added Put_Line.

Sigh. That's what I get for posting without testing. 

Thanks :).

-- 
-- Stephe



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

end of thread, other threads:[~2013-01-13 23:13 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-04  4:27 On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Rod Kay
2013-01-04  4:32 ` Rod Kay
2013-01-05  1:30   ` Robert A Duff
2013-01-05  3:58     ` Rod Kay
2013-01-05 12:37       ` Simon Clubley
2013-01-06  5:29         ` Rod Kay
2013-01-05  5:13     ` Randy Brukardt
2013-01-06  5:26       ` Rod Kay
2013-01-06 22:03         ` Britt
2013-01-05 19:17     ` Georg Bauhaus
2013-01-04 16:31 ` Adam Beneschan
2013-01-04 16:52   ` AdaMagica
2013-01-05  3:41     ` Rod Kay
2013-01-11  8:01       ` John English
2013-01-11 16:48         ` Martin
2013-01-11 19:26           ` Simon Wright
2013-01-05  3:33   ` Rod Kay
2013-01-05  4:19     ` Britt
2013-01-05  5:24       ` Randy Brukardt
2013-01-05  5:18     ` Randy Brukardt
2013-01-04 18:32 ` Simon Wright
2013-01-05  3:47   ` Rod Kay
2013-01-05 14:11   ` Stephen Leake
2013-01-05 18:19     ` Simon Wright
2013-01-09  8:21       ` ada-mode create case exception Stephen Leake
2013-01-11 16:16         ` Simon Wright
2013-01-13 23:13           ` Stephen Leake
2013-01-05 14:06 ` On Style: Any opinions on *not* capitalising the first letter of verbs in a procedure name ? Stephen Leake
2013-01-06  5:37   ` Rod Kay
2013-01-11 16:47 ` Martin

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