• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code Style

 
Alain Huber
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody

I like it better to write code in that fashion:
--------------------------------------------------------------


----------------------------------------------------------
Will I be penalized for doing this the non java way? The code
guidelines from java ranch also see things as I do. Thanks for
the reply

[ November 04, 2007: Message edited by: Alain Huber ]

[ November 04, 2007: Message edited by: Alain Huber ]
[ November 04, 2007: Message edited by: Alain Huber ]
 
abhishek pendkay
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as far as i have seen the sun standards, your code should look as


and i am not sure if you will be penalized for that but its always good to follow the coding standards specialy if they are laid down by SUN

[ November 05, 2007: Message edited by: abhishek pendkay ]

[ November 05, 2007: Message edited by: abhishek pendkay ]
[ November 05, 2007: Message edited by: abhishek pendkay ]
 
Xabier Martija
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to use SUN formatting standard. You may loose some points if you don't follow sun style.

Some IDEs like eclipse provide a very useful automatic formatter, that you can set to follow SUN standard.
Another useful utility is checkstyle, can be downloaded as an pluggin for eclipse.
 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know any other tools like checkstyle that can be used for netBeans even better independent of any IDE ?

thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Musab Al-Rawi:
Do you know any other tools like checkstyle that can be used for netBeans even better independent of any IDE ?


There are plenty: jlint, jcsc, lint4j, pmd and findbugs. All these can be run from within Ant or as standalone applications.

I particularly like FindBugs for its relevant and actionable warnings, and PMD for its extensibility.
 
Alain Huber
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for the reply's.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic