Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Would experienced programmers agree?

807569Jul 4 2006 — edited Jul 12 2006
I 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2006
Added on Jul 4 2006
59 comments
305 views