Hacker News new | ask | show | jobs
by hkarthik 5321 days ago
Can you not start writing tests against those monster methods so that you've got a refactoring safety net?

I totally agree on being practical and not refactoring methods that work correctly. But if you find yourself in the monster methods making changes quite often, it seems irresponsible to not refactor and leave the camp ground cleaner for the next time you or someone else comes through it.

1 comments

Its a big ball of dependencies with no chance to mock due to someone deciding on being "clever". Its up there with being untestable.

Generally I agree. If possible clean it up, but quite often its a small one line change, which needs to be fixed ASAP, so there is little chance to refactor.