
Ask HN: How to deal with low-quality codebase? - chbndrhnns1
I started working for a new project where most of the code has been written by a contractor and the people that approved the code delivery (and the people that wrote the code, obviously) did not seem to care much about testing, non-functional requirements like maintainability, the SOLID principles or other measures of code quality.<p>For most parts, the code looks like code I would have written when I started coding 15 years ago: mixture of model, data, and presentation. Hard-coded credentials. Code duplications. Commit messages like &quot;Commits of Oct 10th&quot;. No use of libraries. You name it.<p>I feel like there is general management support for improving quality while the need to implement new features is also high. We need to maintain, extend, and use this code base which is in production.<p>While rewriting from scratch might be the first idea that comes to mind, I am more interested in your approaches to getting started in such a situation (leaving the project is currently not an option) and what could be effective measures to coaching the current team on quality.
======
informatimago
Bite by bite. Use the facade pattern, implement the new features cleanly
outside of it, and when times allow, refactor and extract modules cleaning
them; until nothing's left behind the facade.
[http://jargon.js.org/_glossary/FACADE_PATTERN.md](http://jargon.js.org/_glossary/FACADE_PATTERN.md)

