Naming convention in Phobos

Nick Sabalausky a at a.a
Sun Mar 6 05:20:28 PST 2011


"Jim" <bitcirkel at yahoo.com> wrote in message 
news:ikvped$1o35$1 at digitalmars.com...
> Okay, so there's a discussion about identifier names in the proposed 
> std.path replacement -- should they be abbreviated or not?
> Should we perhaps seek to have a consistent naming convention for all 
> identifier names in Phobos?
>
>
> Some of the potential benefits:
>
> • Legibility, understandability and clarity (reduce ambiguity).
> • Ease in finding a suitable function/class by name.
> • Knowing if it's a cheap or costly function call.
> • Aesthetics and professional appearance.
>
>
> Some properties that I can think of for discussion:
>
> • Abbreviation (and if so, what to abbreviate and how much)?
> • Preference of commonly used terms in other languages, contexts?
> • Use of get and set prefixes or not (getName() or simply name())?
> • Explicit use of a prefix (example: calc or calculate) for costly 
> operations?
> • Naming of function and template arguments?
> • Uppercase, lowercase, camelcase, underscore in multi-word names? All 
> caps for constants, or different appearance for different types (types, 
> functions, arguments, constants...). What about acronyms: TCP, Tcp?
>
> Are there other concerns?

I think that every individual variable, function and type in Phobos should 
use the naming convention of whatever random language the author happened to 
be thinking of when they wrote it. That way Phobos won't seem messy. Plus, 
the lack of any sensible rules would make it super-easy to remember all the 
different spellings, punctuations and capitalizations.





More information about the Digitalmars-d mailing list