Would experienced programmers agree?
807569Jul 4 2006 — edited Jul 12 2006I was looking at Javaranch, and found the following stated:
3.1 - Constructs to Avoid
Never use do..while. (examples and reasoning)
Never use return in the middle of a method. (reasoning)
Never use continue. (reasoning)
Never use break other than in a switch statement. (reasoning)
3.2 - Do Not Compound Increment Or Decrement Operators
Use a separate line for an increment or decrement. (examples and reasoning)
Never use pre-increment or pre-decrement (examples and reasoning)
3.3 - Initialization
Declare variables as close as possible to where they are used. (examples)
3.4 - Access
All fields must be private, except for some constants.
The reasonings are pretty good. But I have never come across any textbook that gives the same tips as that at Javaranch? Why is that? Does anyones company also follow the same principles as this Javaranch page?