Notes on the Phobos style guide

bearophile bearophileHUGS at lycos.com
Mon Aug 16 15:47:06 PDT 2010


Andrei Alexandrescu:
> [citation needed]
> A cursory googling didn't find many discussions.

The people that have designed C++0x are surely smart and expert, but they have done some mistakes:
- the lambda is WAY over-engineered;
- and the R-value references are useful but they look too much hard for most normal programmers (they may be useful for core library writers). I will not appreciate R-value references in D2/D3.

'auto' in C++0x is a good and useful feature, just as it is useful in D, but as I have explained it has real risks, so it must be used with moderation, if you use it everywhere in the code, your code becomes harder to understand and modify.

Few discussions regarding the 'var' of C#:
http://stackoverflow.com/questions/545616/why-would-var-be-a-bad-thing
http://stackoverflow.com/questions/633474/c-do-you-use-var
http://stackoverflow.com/questions/41479/use-of-var-keyword-in-c

I am sure C++0x style guides (like Google ones) will warn against an excessive usage of 'auto'.

Bye,
bearophile


More information about the Digitalmars-d mailing list