digitalmars.D - Proposal: Name lookup to be style-agnostic
- Benjamin Herr (8/14) Mar 31 2005 I propose a compiler switch that would cause the compiler to "normalise"
- Ben Hinkle (9/23) Mar 31 2005 Writing code that depends on a special compiler switch is fragile. It mi...
Dejan Lekic <leka entropy.tmok.com> wroteI 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
"Benjamin Herr" <ben 0x539.de> wrote in message news:d2ghkb$im1$1 digitaldaemon.com...Dejan Lekic <leka entropy.tmok.com> wroteWriting 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.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