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

DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of...
SYS-CON Events announced today that Conference Guru has been named “Media Sponsor” of the 22nd Inter...
DevOps is under attack because developers don’t want to mess with infrastructure. They will happily ...
The next XaaS is CICDaaS. Why? Because CICD saves developers a huge amount of time. CD is an especia...
Companies are harnessing data in ways we once associated with science fiction. Analysts have access ...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to ...
"Akvelon is a software development company and we also provide consultancy services to folks who are...
Enterprises are adopting Kubernetes to accelerate the development and the delivery of cloud-native a...
In his session at 21st Cloud Expo, James Henry, Co-CEO/CTO of Calgary Scientific Inc., introduced yo...
The question before companies today is not whether to become intelligent, it’s a question of how and...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objecti...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, N...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offe...
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are...
"MobiDev is a software development company and we do complex, custom software development for everyb...
"Codigm is based on the cloud and we are here to explore marketing opportunities in America. Our mis...
High-velocity engineering teams are applying not only continuous delivery processes, but also lesson...
"CA has been doing a lot of things in the area of DevOps. Now we have a complete set of tool sets in...
While some developers care passionately about how data centers and clouds are architected, for most,...
"NetApp is known as a data management leader but we do a lot more than just data management on-prem ...