little thing - D and phobos naming conventions
Chad J
gamerChad at _spamIsBad_gmail.com
Fri Oct 27 19:54:38 PDT 2006
Brian Hay wrote:
> I'm new to D so please forgive my ignorance if indeed that's what it is.
>
> One thing I like about C#.NET and Java is the consistency and
> readability of language keywords and framework classes and methods etc,
> despite the extra verbosity. These languages conform to strict, verbose
> naming conventions e.g. upper camel case for classes, lower camel case
> for methods and variables.
>
> Having said that, I still prefer D (and the development philosophy
> behind it) but, for example, some library method names are inconsistent
> and mostly (but not always) follow the legacy C/C++ conventions of
> lowercase everything and abbreviate to sometimes incoherent acronyms
> wherever possible. I think this makes code less readable, but I know
> this is a subjective opinion.
>
>
> Example inconsistencies:
>
> phobos.std.string
>
> toSting() (lower camel case)
> tolower() (all lower case)
>
> iswhite() (all lower case)
> isNumeric() (lower camel case)
> inPattern() (lower camel case)
>
> tr() not immediately clear what these abbreviations mean
> atoi() what is the aversion to a little more verbosity?
>
>
> Other than the "D Style Guide" doc for coders (which phobos doesn't seem
> to conform to), is there a particular naming convention for the D
> language and standard libraries themselves and what is the rationale
> behind it? (I'm presuming it's to make the language more familiar to
> C/C++ coders)
>
> Everything else about D is so cool, modern, well-designed and
> cutting-edge but some of this naming is so "old school". I know I'm
> being anal and this shouldn't get on my nerves ... but alas it does.
>
>
> Brian.
uh, too true.
I'd really love to see a release of phobos that has all of these
inconsistancies fixed, and while we're at it let's fix the
death-by-abbreviation names too.
I'm pretty much willing to not only rewrite my own code, but other
peoples' too.
More information about the Digitalmars-d
mailing list