DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Coding Standards ARE Important

Jens Schauder user avatar by
Jens Schauder
·
Feb. 12, 13 · Interview
Like (0)
Save
Tweet
Share
5.63K Views

Join the DZone community and get the full member experience.

Join For Free

zac gery thinks when it comes to coding standards:

in most circumstances the unrecognized pitfalls outweigh the benefits

i strongly disagree! but lets go through his points one by one:

some team members equate coding standards to a lack of confidence in his/her abilities. others find standards such as spacing and/or comments to be micro-managing.

pardon me? if you have team members that have an issue adhering to simple team rules like “we want our {s on a separate line” and consider that a personal insult you have some serious issue in your team. software development is a team effort. if you are working in a team you have to adhere to the rules of the team, no matter if they are written down or exist as implicit knowledge of the team.

coding standards stifle and discourage coding creativity. some of the best code comes from an unfiltered mind.
they create unneeded stress within a team as members disagree with various standards. these discussions can spiral into negative, unproductive debates.

hands up: who considers it an important part of their creativity to decide on every line how far to indent it? that’s what i thought. discussions about coding standards? yup, we have those too. but there is no spiral involved. somebody brings up a concern like “i think we should stop prefixing field access with this.” we exchange arguments and opinions. then we decide. end of debate. again, if you have constant fights in your team about this kind of thing, you have a serious problem in your team and its not the code style guide.

each new rule adds to the overall complexity of implementation, enforcement, and maintenance of coding standards.

99% of all coding standards get implemented and maintained by your code formatter. the stuff that doesn’t gets enforced by tools like checkstyle. therefor there really isn’t any relevant effort involved. coding standards reduce these efforts because it prevents formatting wars and reduces the time needed for reading code.

each concession to a rule devalues the overall purpose of coding standards.

that’s like saying we should legalize murder since every killing devalues the laws against it. doesn’t make any sense.

coding standards distract from the larger goal of building, testing, and releasing functionality in a timely manner.

i still don’t get it. how is it less distracting, when i have to check if a token references a class or a field just by checking if it starts with an upper case character? how is it less distracting, when i have to search for matching curly braces because the code is not properly indented?

deciding how to handle existing code that pre-dates the creation of a standard is a winless battle.

again, why battle? have a discussion, make a decision, be done with it. get used to it, this is an important part of working in a team.

when a coding standard is not followed, what happens to that code? must it be fixed immediately? how does that effect its testing, retesting, or release time lines? some consider this code to be technical debt. that is a difficult label to apply to code if the violations are simply style related.

since coding standards should be trivial to follow they should break your build and get fixed. if you or team members have a problem with that: have a discussion, make a decision, be done with it. what is the problem with the label technical debt? violation of coding standards make it harder to read that code. that is the interest rate you pay for that debt until you pay it back. fits perfectly. of course how large that debt is when a single { is misplaced is a different question. but then again, paying that back should be as simple as opening the file and pressing a shortcut.

proper enforcement of coding standards can consume an unreasonable amount of time.
the decision to enforce coding standards and its consequences must be embraced at all levels within a company. most companies struggle to embrace doing something twice.

why is enforcing rules “doing something twice”? don’t understand that. for the first sentence. of course you can come up with coding standards that are hard to enforce. just don’t. use standards that play well with your tool setting. automate it. and think again if your coding standard has to be company wide. this works well for small companies, but results in coding standards 1000 pages thick and completely useless. i have seen those. that shouldn’t keep you from having coding standards for your team.

zac continues to recommend code reviews. a good thing! but not a replacement for coding standards.

you absolutely should have coding standards in any team consisting of two or more developers. part of deciding on the standards to use should be the way to enforce them and this should be largely automatic.

even more important than coding standards is a team standard on how to make decisions. if that standard fails in the trivial case of coming up with coding standards you have a serious problem.

and don’t go for compromises when it comes to coding standards ( by geek&poke )
coding standard compromise by geek & poke

Coding (social sciences) teams code style Software development

Published at DZone with permission of Jens Schauder, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Upgrade Guide To Spring Data Elasticsearch 5.0
  • Mr. Over, the Engineer [Comic]
  • ChatGPT: The Unexpected API Test Automation Help
  • AWS Cloud Migration: Best Practices and Pitfalls to Avoid

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: