Code Smell 48 — Code Without Standards

Working on a solo project is easy. Unless you go back to it after some months. Working with many other developers requires some agreements.

Photo by De Jesus de Blas — Russia

Problems

  • Readability

Solutions

  1. Enforce agreed policies.

Sample Code

Wrong

Right

The right example has several other smells, but we keep it loyal to its GIT version in order to show only code standardization issues.

Detection

We can add our own naming conventions related to Objects, Classes, Interfaces, Modules etc.

Examples

Tags

Conclusion

A well-written clean code always follows standards about naming conventions, formatting and code style.

Such standards are helpful because they make things clear and deterministic for the ones who read your code, including yourself.

Code styling should be automatic and mandatory on large organizations to enforce Collective Ownership.

Relations

More info

The nice thing about standards is that there are so many to choose from.

Andrew S. Tannenbaum

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Sign up for Best Stories

By Dev Genius

The best stories sent monthly to your email. Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Maximiliano Contieri

Written by

I’m senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan.

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store