Digital Edition

SYS-CON.TV
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

Your homes and cars can be automated and self-serviced. Why can't your storage? From simply asking q...
Creating replica copies to tolerate a certain number of failures is easy, but very expensive at clou...
"This week we're really focusing on scalability, asset preservation and how do you back up to the cl...
"I focus on what we are calling CAST Highlight, which is our SaaS application portfolio analysis too...
"We work around really protecting the confidentiality of information, and by doing so we've develope...
"Software-defined storage is a big problem in this industry because so many people have different de...
"Our strategy is to focus on the hyperscale providers - AWS, Azure, and Google. Over the last year w...
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the bu...
"We're focused on how to get some of the attributes that you would expect from an Amazon, Azure, Goo...
Andi Mann, Chief Technology Advocate at Splunk, is an accomplished digital business executive with e...
Explosive growth in connected devices. Enormous amounts of data for collection and analysis. Critica...
"We're here to tell the world about our cloud-scale infrastructure that we have at Juniper combined ...
In his session at 20th Cloud Expo, Brad Winett, Senior Technologist for DDN Storage, will present se...
Hardware virtualization and cloud computing allowed us to increase resource utilization and increase...
"Cloud computing is certainly changing how people consume storage, how they use it, and what they us...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, disc...
DXWorldEXPO LLC announced today that the upcoming DXWorldEXPO | CloudEXPO New York event will featur...
Without a clear strategy for cost control and an architecture designed with cloud services in mind, ...
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan...
You often hear the two titles of "DevOps" and "Immutable Infrastructure" used independently. In his ...