The Broken Window Theory

Uzoma Nwanne - Dec 6 '22 - - Dev Community

The Broken Window Theory suggests that neglected urban alleys encourage crimes. Most dilapidated buildings in urban alleys start with a small neglect which encourages other persons to gradually and unknowingly aid in vandalizing the building because the owners have given the impression that they do not care.

As developers, this theory is applicable to our work. Small neglects that you should have corrected initially encourage further neglects from you and your team members and before you know it, you have a heap of messed up code that should have been avoided.

So as you code, make conscious efforts from the beginning to comment on your code, and use proper naming conventions that make sense. If you find yourself copying a segment of code more than twice, you should consider refactoring that code. Ensure that your classes are not tightly coupled.

What other practices can we adopt to ensure we have quality code? I look forward to getting more suggestions.

. . . .