Sunday, October 20, 2019

Java Coding Guidelines


Does your company have a standard or set of coding style guidelines for writing Java code? Have you ever tried to write one?!?  From past experience, I'd recommend against it. Instead, I'd point you and your Java developers / programmers to Sun's Code Conventions for the Java Programming Language. This guideline has been vetted over many years and the entire JDK mostly follows it. As a result, most Java programmers are familiar with them, and Java code that follows these guidelines is generally readable by all Java programmers.

That being said, I'm going to ignore my own advice and begin writing a Java Coding Guideline for my company. "Why?" you ask...

Well, I believe that Sun's guidelines are good, but incomplete. Remember, Sun's audience was much larger than my company's audience, and therefore, had to be agreed to by a much more diverse group. Being smaller in size, we have the luxury of espousing and enforcing more specific coding practices - hopefully enhancing the quality, consistency, and effectiveness of our services.

So, where should I start? How does one go about crafting such a document?

Well, I believe the first thing that needs to be done is to create a vision - the same thing I would do for any new project.

Yikes.

Hm... Well, we are an integration and consulting company that works with and customizes software products that are Java-based, so it stands to reason that our Java code should be well-integrated with those products. And our projects generally deploy into enterprise-level production systems, so the code should be high quality, production-ready. And since it's very likely we'll eventually turn over the code to the client, our code needs to be supportable and maintainable by other programmers.

So, the vision is:

To write a set of Java Coding Guidelines that:
  • Enhances my company's ability to write, test, deploy, maintain, and reuse its Java codebase.
  • Consistently and seemlessly integrates with the Java codebase of the software products my company's vendor partners create and sell.
  • Consistently and seemlessly integrates with my company's clients' existing and new Java codebase.

No comments:

Post a Comment