DEV Community

Uzoma Nwanne
Uzoma Nwanne

Posted on

The Broken Window Theory

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.

Top comments (4)

Collapse
 
cicirello profile image
Vincent A. Cicirello

Consider adding a couple relevant tags to your post. It will help increase how it is seen in feeds. I think #discuss is probably a good tag for this based on your last paragraph.

Collapse
 
uzomanwanne profile image
Uzoma Nwanne

Thanks for the insight

Collapse
 
cicirello profile image
Vincent A. Cicirello

You're welcome

Collapse
 
cicirello profile image
Vincent A. Cicirello

Very interesting metaphor. I've definitely seen projects where this applies.