Digital Edition

SYS-CON.TV
Most Read This Week
Enerjy Software: Why Coding Standards?
Enerjy Software: Why Coding Standards?

Click here for more information on Enerjy Software

  Click here to watch Nigel Cheshire, Enerjy Software on SYS-CON.TV

It's a fact of life: different developers like to write code in different styles. Show me code written by 10 different developers, and I will show you 10 different coding styles. So why try to develop and enforce coding standards? There are two core reasons:

  1. Comprehension of Other's Code. Adopting a set of coding standards makes it easier for developers to read and understand each other's code. Although peer review is not the norm in every development shop, almost everyone has to maintain - or, at least, step through - code written by someone else.
  2. Pre-empt bugs. Adopting coding standards also serves to pre-empt bugs. Everyone knows that the cost of fixing a bug rises exponentially over time. Finding and fixing bugs in the development phase - and preferably even prior to unit testing?can save hours of time and resources later. Certain coding standards can make it less likely that bugs will be introduced into the code, and if those standards can be applied as the code is written, the savings will be huge.
Code Analysis Tools
Many well-meaning people have adopted the idea of coding standards, only to have them fall into disuse. The problem is that you have to be very self-disciplined to remember to apply all of the standards while you are writing code. You have to learn and memorize them all (Sun's coding standards are very concise, but they still run to 20 pages), and then remember to apply them all the time.

Code analysis tools, such as Enerjy Code Analyzer, give developers an easy way to check their code against a set of standards as it is being written. This is a significant step forward in promoting the adoption of standards, since it makes it easy for developers to police themselves and reduce the mundane so they can move on to the more challenging coding aspects of their application.

Working something like a grammar checker in a word processor, Enerjy Code Analyzer applies a preconfigured set of rules to the code as the developer is writing it (in fact, it runs on each File, Save operation), and points out any violations of the coding rules. Moreover, for many of the rules-in particular, the more straightforward ones-Code Analyzer will even suggest and apply a fix for you.

Getting the Most from Your Code Analyzer
The key to a successful implementation of a tool like Enerjy Code Analyzer is in defining your rule set. This should be based on-and, ideally, should totally define-your own set of coding standards. Although Enerjy Code Analyzer ships with nearly 200 configurable rules built in, you can also add your own rules to encompass your organization's special standards by writing new Java classes and integrating them with the analysis and reporting engine.

The standard set of rules breaks down into a number of areas:

  • Standards compliance
  • Unused elements
  • Common coding errors
  • J2EE compliance
By default, Code Analyzer is triggered on each File, Save operation, which makes it virtually seamless as far as the developer is concerned.

After each analysis, Code Analyzer adds a report of any violations as warning messages in the IDE; clicking on a message will place the cursor on the offending line in the code, taking you right back to your curly braces and semicolons. For those rules that can be auto-fixed (e.g., missing braces), right-clicking on the message will allow the problem to be automatically fixed. Alternately, all auto-fixable problems can be fixed at one time.

Enerjy Code Analyzer includes extensive and enlightening built-in help via a tap of the F1 key - a learning tool for starting Java developers - or a handy reminder for more experienced developers.

Finally, the output from an analysis session can be saved to a report, in either HTML or XML format.

One final point: the easiest way to implement a set of standards is to quickly get to the point where your code generates zero errors, and then keep it that way. If you establish coding standards with every development project, you'll pre-empt pesky bugs, save time, and develop more reliable applications.


Click here for more information on Enerjy Software

About IT Solutions Guide
IT Solutions Guide (ITSG), aimed at development and corporate managers, is a free quarterly supplement focusing on the most competitive tools, solutions, and services available in the IT and infrastructure technology world today.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1



ADS BY GOOGLE
Subscribe to the World's Most Powerful Newsletters

ADS BY GOOGLE
Today's Top Reads
My colleague, Peter Palmieri, just penned a blog post about Microsoft’s recent announcement that the...
Despite its uncertain fate Sun soldiers on. Monday it trotted out a cloud-based multiplatform deskto...
EMC has cut its 2009 guidance because it’s going to take a $100 million to restructure its internati...
While Microsoft is webifying bits and pieces of its client/server Dynamics ERP solution, it ain't go...
Given the time, money as well as effort IBM has poured into promoting and generating awareness aroun...
Broadcom is paying $178 million and mostly cash for nine-year-old privately held Israeli-based Dune ...
IBM says it’s been hired to build an e-government cloud for Saigon, now Ho Chi Minh City, the one-ti...
This past weekend I set out explore some of the extension capabilities of Google Wave. One of the we...
This coming Tuesday, December 8, at 2:00PM EST, SYS-CON.TV will be broadcasting live from its 4th-fl...
SugarCRM, the world’s leading provider of open source customer relationship management (CRM) softwa...
There's a lot of talk about how we need to focus on our buyers' issues and provide them educational ...
SYS-CON Events announced today that the "show prospectus" for the 5th International Cloud Computing ...
SYS-CON Events announced today that the "Diamond" and "Platinum" sponsorship opportunities for the u...
More good news for cloud computing! Google last week released its once mysterious Chrome Operating S...
In CloudBerry Lab we are striving to make our customer service better. In this competitive market wi...
We talk a lot about social media on Marketing Trenches. And for good reason – Social media seems to...
Intel has put out its promised beta SDK for Windows (C and C++) and Moblin (C) developers working on...
InformationWeek stumbled on a Microsoft patent application dating back to 2006 deceptively titled “M...
Berlin-based ThinPrint AG, the printer virtualization house, thinks it’s got a cloud solution for th...
IBM has acquired Guardium, a seven-year-old subsidiary of Israel’s Log-On Software transplanted to M...