Hacker News new | ask | show | jobs
by mahyarm 4368 days ago
How do you deal with bad coding practices? Such as over complicated & verbose code and copy paste everywhere leading to an unmaintainable mess?
1 comments

Short answer: testing.
Unmaintainable copy paste code can still past tests in a degenerate way. And things like UI code and other things that majorly depends on 3rd party code definitely is harder to make proper tests for.
Not just automated testing, quality assurance.

The job of QA is to find bugs.

The job of automated testing is to reduce the cost of QA.

With proper project documentation and separation of backend from interface using DOM templating as well as a compartmentalised, non-monolithic application architecture (ie. not using "frameworks" in the traditional sence) the code that drives an interface is not only trivial to build but also pretty trivial to replace.