Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coding Convention

 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have read the coding convention on the Sun website. One of my old habbit is not on the doco so I don't know if it is good or not. Can somesone tell me if I can do this?

I always found this is clearer than the ways it is recommended by the Sun Coding Convention for simple condition checking:


Thanks,
Anna
 
Eiji Seki
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should stick with the second one, since that is the official convention.
Conventions are supposed to be followed, and good conventions minimize the exceptions. If there were many of them, it would be pointless, since the code would look chaotic.

Specially if they were to use some relative requirement like "if it is simple". Much better and easier if we just use the same rule for all cases.

Besides, spaces around == operator is a great idea.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic