Hacker News new | ask | show | jobs
by the_mat 5351 days ago
There's a dangerous flip side to this: In my experience just about all programmers want to remove things from code that they don't understand or see the reason for. Why is that weird check there? Who thought it was a good idea to allocate memory that way? Very often there ARE good reasons for those decisions, and they can stem from bug fixes or odd special cases that may not be obvious..

Moral: Be careful.

1 comments

Right, which is why you don't just remove the onion because you feel like it. In that story, he found out why they used to put the onion in and determined it was no longer necessary.

Moral: if you don't understand code, don't change it, understand it.

> understand it.

This has been said in some replies in this tree, but sometime you can take the piece of code you don't understand as a black box, and bridge its behavior with new code, comparing both outputs during a few iterations, then remove old code.