Naming convention in Phobos

dolive dolive89 at sina.com
Sun Mar 6 04:49:53 PST 2011


Jim Wrote:

> 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?

非常赞同,尽量不使用长名称但也不排斥,学习java命名哲学,让全世界都看得懂(非英语国家)

如果有多个同义词,请使用词频更高的

Very much in favor!

Try not to use the long name But not exclusive, Learning java naming philosophy, If you have multiple synonyms, Please use the word frequency higher, Let the whole world are able to understand (non-English speaking countries)

thank you very much!

dolive










More information about the Digitalmars-d mailing list