D Style document

Dejan Lekic dejan.lekic at gmail.com
Wed Mar 12 20:26:47 UTC 2025


On Saturday, 8 March 2025 at 18:46:16 UTC, Jonathan M Davis wrote:
> The naming rules are rules that every public library should be 
> following if the developers working on it want to fit into the 
> D ecosystem, and some programmers will complain if a library 
> does not follow the official naming guidelines (whereas some 
> other progammers won't care much). Ideally, everyone would be 
> following the naming guidelines in the style guide, but some 
> people prefer not to for a variety of reasons. And of course, 
> when you're dealing with bindings to other languages, you can't 
> always follow the D naming conventions.

Even if I do not deal with bindings, but just work on a library 
(public, opens-ource) I still do not prefer the camelCase enum 
member names because the most obvious choices CLASH with D 
keywords. The most obvious one, that many people would want to 
use I am sure, but they can't is `default`. Another conflicting 
one is `double` that you want to use for values that are double 
of the previous enum value, etc...


More information about the Digitalmars-d mailing list