renamepalooza time

spir denis.spir at gmail.com
Sat Jan 22 19:08:53 PST 2011


On 01/23/2011 12:03 AM, Ali Çehreli wrote:
> Jonathan M Davis wrote:
>> On Friday, January 21, 2011 13:30:11 Ali Çehreli wrote:
>>> Andrei Alexandrescu wrote:
>>> > iswhite
>>>
>>> I like separating is with an underscore, like most coding styles do:
>>>
>>> is_whitespace
>>>
>>> Warm and fuzzy... :)
>>
>> Most? I've never dealt with a coding style that had underscores.
>
> Sorry for being unclear. My comment was only in the context of is_. I
> like separating "is" with an underscore. Probably because "is" is not
> part of the name. It operates at a different linguistic level.
>
>  > It's generally
>> camelcase, though I get the impression that using underscores in C
>> code is more common (I've mostly used C++ and Java).
>
> Same here: always camelcase, except in our C libraries. Now I like
> underscore more than before. :)
>
>  > Regardless however, Phobos' coding style
>> uses camelcase, not underscores. And this whole thread was started to
>> try and find better names for functions which need new names, because
>> they don't currently follow Phobos' naming conventions.
>
> I am aware of that. Then half seriously, let's change the standard to
> use underscore after "is". Also when parts of a camelcased name are too
> loosely related.
>
> For example, when NodeReader is an interface and when we already have a
> LovelyDb, we may have a class named LovelyDb_NodeReader.
>
> Ali

Nice & sensible way of mixing both conventions :-) Sounds similar to 
using whitespace for visual grouping like in
	a*b + c*d
or
	[ [1,2,3] , [4,5,6] ]

But may be a bit too complicated for a public, free-willing, style, 
don't you think? Rather for an enforced project or corporate one, I'd say...

Denis
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list