Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Code Style

 
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 ]
 
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 ]
 
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.
 
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
 
Rancher
Posts: 43016
76
  • 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.
    Bookmark Topic Watch Topic
  • New Topic