DEV Community

Discussion on: 5 easy wins to refactor even the worst legacy code

Collapse
 
moopet profile image
Ben Sinclair

Your code in #4 shows off the dangers of refactoring without tests, though. You change ! .. <= into >= where it should just be >. I can't count the number of times I've made that mistake "fixing" other people's code.

Well, I could count it, but I'd probably be off by one...

Collapse
 
mlevkov profile image
Mikhail Levkovsky

good catch! Will update the gist, many thanks!