JNode needs a style guide
I've seen quite a bit of the JNode code base, and one thing that I find irritating is the inconsistent and occasionally bad coding style. I see:
- inconsistent indentation,
- inconsistent use of whitespace around operators, before and after braces, parentheses, etc
- inconsistent spacing between lines,
- files containing TAB characters,
- minimal useful in-line comments
- useless or non-existing Javadoc comments on key methods, or entire APIs.
I've also come across some basic coding errors that would have been picked up by a cursory code review. I've seen command classes that catch java.lang.Exception, command classes (with 'execute' methods) that write to System.out / System.err rather than the command's out/err, code that repeatedly looks up the same system service in loops. I've seen left-over trace prints, and Unsafe.debug calls. I've seen code that is so hacked around that it is unintelligible. And some of codebase's the lack of concern for multi-threaded access is truly frightening!
I think it is time that we formally set out some JNode code style guidelines ... and start paying attention to the quality of code that gets checked in.
For the record, I've been developing code in many languages and many contexts for over 30 years now. In my experience, consistent code style is very important to the long-term maintainability of a code-base. While getting the code style right can be a chore, it is worth the effort in the long term. Besides, an IDE like Eclipse or IntelliJ (or even good old Emacs) can do a reasonable job of fixing up your code's indentation.