Anonymous
Unregistered
|
|
This masses of source code printed would have been more useful if the author had used proper coding conventions.
|
Anonymous
Unregistered
|
|
I recognized the author, Allan Holub, immediately by his own coding conventions. He's got this thing for being able to run his code through a spell checker. Needless to say, he eschews the Java coding conventions. Obviously, the important thing to do though is to focus on the code design, not on his style.
|
Anonymous
Unregistered
|
|
I'm not sure what you mean by "proper" coding conventions. The main issues are readablity and maintenance. I personally think my code is a lot easier to read that most :-), but people seem willing to argue for hours about how to place braces. Seems silly.
It's hard for me to belive that you find the code less valueable because_I_use_underscores rather than MungingEverythingTogetherIntoOneWord.
Java is somewhat conflicted about the MixedUpperAndLowerCase style versus the_underscore_style. The former comes from Pascal, the latter from C/C++. (Microsoft, by the way, adopted the Pascal style because the original Windows APIs were for Pascal! We all thought that Pascal was the language of the future back then.) Given Java's obvious connection to the C/C++ side of the world, using C/C++ naming conventions seems reasonable. The Java standard recommends PascalStyleMungingTogetherOfWords in one place, but it also permits underscores in an identifier. If underscores were evil, then why are they in the language spec?
I personally think that you should go with whichever style makes for the best readability. I *do* run my code through a spell checker, both because I'm a lousy speller and becuase I strongly believe that identifiers should be words in a dictionary so that a non-English-speaker can maintain the code. (What's a native speaker of French going to do with 17 consonants munged together, some upper case and some not?) Nothing improves readability more than well-chosen identifiers that actually read correctly in English.
Anyway, the underscores work for me because they're treated as punctuation by the spell checker.
|
Anonymous
Unregistered
|
|
Dont you see inconsistencies in the style within the same class:
setVisible(true); return selector.get_selected_date();
It seems like if the whole world wants to go this way, just for the heck of it you want to go the other way!
|