Strictness of language styling

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 10 11:35:04 PST 2014


On Mon, Nov 10, 2014 at 09:19:58PM +0200, ketmar via Digitalmars-d-learn wrote:
> On Mon, 10 Nov 2014 16:16:04 +0000
> "Adam D. Ruppe via Digitalmars-d-learn"
> <digitalmars-d-learn at puremagic.com> wrote:
> 
> > Personally, I don't really care about naming conventions. I prefer
> > the camelCase and it seems most D people do, but if you're
> > translating another library, there's value it keeping it the same
> > for ease of documentation lookups from the original etc.
> +1 to this. it's better to use camelCase for shiny new code, but for
> ports it's desirable to keep names unchanged where appropriate, for
> easy googling and so.

I have to say that I *hate* camelCase... it looks really ugly. But what
looks uglier is a mixture of camelCase and something else. And since
Phobos is all camelCased, and almost all D code uses Phobos, writing
your own code with something else makes it doubly ugly. So nowadays I
just use Phobos style for my own code. :-P  Nevertheless, I still
dislike camelCase.

But as in any group project, especially large ones, the best policy is
to follow the coding style of the surrounding code, even if it clashes
with your own. Even worse than mixing camelCase with non_camel_case, is
a source file that looks like a mosaic (or complete jumble) of multiple,
incompatible coding styles all thrown together. An unfortunately
frequent occurrence in large group projects without an adopted set of
coding conventions. :-(


T

-- 
The diminished 7th chord is the most flexible and fear-instilling chord. Use it often, use it unsparingly, to subdue your listeners into submission!


More information about the Digitalmars-d-learn mailing list