Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Code Style

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks for the reply's.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic