Topic: STL & Class names


Author: beman@dawes.win.net (Beman Dawes)
Date: Fri, 23 Dec 1994 14:23:22 GMT
Raw View
In article <3d3tom$laj@inferno.mpx.com.au>, Alex Kowalenko (alex@jolt.mpx.com.au) writes:

>I've noticed that the default style for naming classes in STL and in the
>standard library is to start them with lower case letters.  Has this
>been a decided upon convention for classes in the standard library,
>or it's just happened that way?

Initially, several naming conventions were discussed by the
committee's library working group (LWG).  The "lowercase letters
with underscores separating words" scheme had slightly more support
than any of the other schemes.  The full committee supported this
decision.

The library working group revisited the issue a number of times.
Each time a larger majority voted to stick with the current
convention.  IMHO it is very unlikely the LWG will even consider
changing naming conventions this late in the game.

-- Beman    (beman@dawes.win.net)




Author: alex@jolt.mpx.com.au (Alex Kowalenko)
Date: 19 Dec 1994 12:19:34 GMT
Raw View
I've noticed that the default style for naming classes in STL and in the
standard library is to start them with lower case letters.  Has this
been a decided upon convention for classes in the standard library,
or it's just happened that way?  Perhaps the standard class names are
following the same format as C(++) built in types int, char, float ...

One side effect of this is that class names are harder to find in
code if the are un-capitalised

 Vector<char> v = ....

is easiler to spot than say

 vector<char> v = ....

(Visualise the previous examples with, say, 50 lines of code on both sides
and if they are using STL, un-capitised class names.)

I noticed this while going through some example code on the STL.
Don't get me wrong, I think that STL is great.

Alex Kowalenko




Author: ark@research.att.com (Andrew Koenig)
Date: Tue, 20 Dec 1994 16:05:44 GMT
Raw View
In article <3d3tom$laj@inferno.mpx.com.au> alex@jolt.mpx.com.au (Alex Kowalenko) writes:

> I've noticed that the default style for naming classes in STL and in the
> standard library is to start them with lower case letters.  Has this
> been a decided upon convention for classes in the standard library,
> or it's just happened that way?  Perhaps the standard class names are
> following the same format as C(++) built in types int, char, float ...

Exactly.  Also, we have noted that very few vendors use
all lower case for their class names, which means that the
new standard library will be less likely to clash with
existing libraries if it sticks to lower case.
--
    --Andrew Koenig
      ark@research.att.com




Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 20 Dec 1994 19:23:32 GMT
Raw View
In article laj@inferno.mpx.com.au, alex@jolt.mpx.com.au (Alex Kowalenko) writes:
>I've noticed that the default style for naming classes in STL and in the
>standard library is to start them with lower case letters.  Has this
>been a decided upon convention for classes in the standard library,

Yes. All reserved words and standard class names are all lower-case.

>or it's just happened that way?  Perhaps the standard class names are
>following the same format as C(++) built in types int, char, float ...

Yes, that's why.


>One side effect of this is that class names are harder to find in
>code if the are un-capitalised
>
> Vector<char> v = ....
>
>is easiler to spot than say
>
> vector<char> v = ....

Maybe so.

---
Steve Clamage, stephen.clamage@eng.sun.com