On 01/22/2011 02:16 AM, Andrei Alexandrescu wrote:
On 1/21/11 4:49 PM, 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. 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). 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.

Ever since I worked with STL, I fell in love with
names_with_underscores. I can't explain it, but my feeling is that code
using that convention is calm and levelheaded. Camel case forces me to
think of one-word names because at the second word some beauty is
already lost; never felt the same with the underscores. If I could go
back in time I'd propose that convention throughout.

Andrei


My problem with underscore-delimited identifiers is that they can get really hard on eyes:

int my_temp_var = some_object_instance.some_field.some_other_field;

The dots are completely lost. Also, when identifiers are getting long (and in large libraries they tend to) the underscores become to look pretty annoying. I have worked with many conventions and camelCase remains my favorite for now.

Reply via email to