www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Proposal: Name lookup to be style-agnostic

reply Benjamin Herr <ben 0x539.de> writes:
Dejan Lekic <leka entropy.tmok.com> wrote
 I agree, but what I hate even more is when I am forced to use
 God-hated JAVA code-style ( variableNames , methodNames() , ...).
 IMHO D's standard library - Phobos should follow STD C naming scheme
 and use simple method_names() ... Who knows, maybe D's community is
 full of JAVA programmers... Than I would understand current D
 direction.
I propose a compiler switch that would cause the compiler to "normalise" identifieres when resolving symbols, so all underscores surrounded by non-underscores get removed, and the whole name gets lowercased. Alternatively, such an engine could, if there are no direct matches, try to replace capital letters inside of words with a underscore followed by the lowercase version of the letter; and vice-versa. -- Benjamin
Mar 31 2005
parent "Ben Hinkle" <bhinkle mathworks.com> writes:
"Benjamin Herr" <ben 0x539.de> wrote in message 
news:d2ghkb$im1$1 digitaldaemon.com...
 Dejan Lekic <leka entropy.tmok.com> wrote
 I agree, but what I hate even more is when I am forced to use
 God-hated JAVA code-style ( variableNames , methodNames() , ...).
 IMHO D's standard library - Phobos should follow STD C naming scheme
 and use simple method_names() ... Who knows, maybe D's community is
 full of JAVA programmers... Than I would understand current D
 direction.
I propose a compiler switch that would cause the compiler to "normalise" identifieres when resolving symbols, so all underscores surrounded by non-underscores get removed, and the whole name gets lowercased. Alternatively, such an engine could, if there are no direct matches, try to replace capital letters inside of words with a underscore followed by the lowercase version of the letter; and vice-versa. -- Benjamin
Writing code that depends on a special compiler switch is fragile. It might sound convenient to mess with identifiers but case sensitivity (and underscore sensitivity) has survived for a reason. If someone doesn't like a set of names they can use aliases or stick to their own libraries where they can use whatever naming convention they like (if any at all). IMO the OP doesn't know much about Java because they can't even spell it correctly.
Mar 31 2005