Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you’re describing something else. The defining characteristic of ugly code is it’s hard to reason about and thus not easy to maintain. It can still reliable, functional, and ugly.


People (myself included) usually overestimate their ability to ship more readable code that has bug-for-bug parity with complex existing codebase.


I think you’re getting at a deeper issue. The need for bug-for-bug parity internally is itself a sign of technical debt.

At this point we can’t for example fix historical calendars, so all highly accurate date and time related code is going to be complicated and full of edge cases. Such code is in effect an interest payment on society’s existing technical debt. So, the temptation to refactor such code is generally attacking the wrong side of a problem. The best approach may be to quarantine such code/systems and try and minimize the impact of such issues.


I could have said “feature parity” it doesn’t change the argument much.

> The best approach may be to quarantine such code/systems and try and minimize the impact of such issues.

That’s the old Google’s “v2 is wip v1 is obsolete”. Works ok internally, externally not so much


I think step zero for this kinda thing should be writing a test suite using the current code as the reference implementation. Then you spike it out with a first pass and if your clean version can’t get 90%+ without lots of edge case handling or abstraction breaking then you keep what you have.


That’s exactly my point - chasing that 10% remainder will make the new thing similarly hacks-ridden as the original




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: