Skip navigation.
Home

Let's write Java code that adheres to a coding standard.

I think all of us wants to write code as book says.\\ But most of us didn't knows all the coding standards and what you think it is good it may not be so.\\ Even if you read for example the Java coding standared you will forget some things (I'm sure of that).\\ \\ so we need some persone to review our code and and tell us thats good or thats bad, what if there exists tools that helps you doing that.\\ I'm using amodule called Checkstyle that I configered it to work with net beans.\\ Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. \\ It automates the process of checking Java code to spare humans of this boring (but important) task.\\ This makes it ideal for projects that want to enforce a coding standard.\\ \\ Checkstyle is highly configurable and can be made to support almost any coding standard.\\ An example of what you code do in the configuration file is to support the Sun Code Conventions and more \\ you can write your owen regular expression that can be used for checking the variables naming conventions.\\ \\ offcourse you can configure checkstyle or other tools with any other IDEs or even with maven or ant or others.\\ \\ and this is the link for nbCheckstyle Home Page\\ http://nbcheckstyle.sourceforge.net/ \\

Eclipse also

Eclipse also has a similar tool, Open the Window menu --> Prefrences --> Java --> Code Style --> Formatter
click new and formate ur code as u like


Infact, what really matters with me is the code review in terms of coding guidlines, for example should if a method supposed to return an array, and inisde that method i found that there will be no valuse inside the array, so the question is: should the method return null or return an empty array?, the best practice is to return an empty array, and it will be highly appreciatable if there is atool that can do that code reviwing.


Well, infact there is a one inside IBM-RAD6, i will be submitting a review about it later on :)







New code formatter

The Java code formatter has many improvements to offer: The Java > Code style > Code Formatter preference page lets you choose from existing profiles, define your own, and share them with others.


Code Formatter preference page


The new formatter is highly configurable, with over 140 options covering everything from brace positions to wrap lines up to Javadoc comment formatting.


 

Oracle JDeveloper 10g CheckStyle plug-in

slamo 3alekom, this is the CheckStyle plug-in for Oracle 10g JDeveloper users http://maven.apache.org/maven-1.x/plugins-sandbox/jdeveloper/checkstyle/ Ismail Issa ----------------------------------- MySQL Certified Database Developer -----------------------------------

Code Analyzers

Code analyzers != Code Formatters Eclipse Code Analyzers plugins are at http://eclipse-plugins.2y.net/eclipse/plugins.jsp?category=Source+Code+Analyzer&sort=hits24h

I agree with Tamer

I agree with Tamer! \\ I would like also to say that Code Formatting should actually follow the Coding Standard you are following in your project. This should usually set in a project or company level.\\ The tools support (checkstyle, PMD, .. ) is very useful for both the developer and the reviewer.\\In a pervious J2EE project, we were using a customized version of this https://jjguidelines.dev.java.net/ .\\ It has also a check style config file that can be used.\\