4 ms·
Ii doesn't take courage. Just a little experience tells you that code you delete is less code to maintain. And if you want to build anything non-trivial, main
by jsankey 15y ago
Ii doesn't take courage. Just a little experience tells you that code you delete is less code to maintain. And if you want to build anything non-trivial, maintainability is absolutely critical.
I love deleting code.
- wladimir 15y agoIt does courage to remove code if you have to deal with customers or users that, it turns out, relied on the feature. A good example of this is Google Docs. In the first version of Docs, it was possible to change CSS style sheets and make changes to the low-level document. You could change background colors and so on. In the rewrite they removed this functionality to achieve "more simplicity". However, many people were relying on the customizability, so they have a ton of complaints about the new version. It appears that the current decision is to keep the old version "forever". Of course, whether this is true remains to be seen. But the lesson is that even if you think a certain feature is useless, people might be relying on it. You're never sure how customers are actually using your program. So if you "boldly" delete something you might end up maintaining more versions, have to reinstate the deleted code, or lose customers. I think that's where the courage comes in.
- random42 15y agoNo one is arguing for throwing away the code. There is certain amount of brains, efforts, time and money spent on writing code. What is argued is, the active current code should be readable. Version control systems, handle older versions of code very well.
- wladimir 15y agoTo your users, removing something from the latest release is equivalent to throwing away the code. Sure, you can trivially bring it back using source control, but the user can not, so the damage might already be done.
- random42 15y agoEnd users do not get affected by commented code. A more direct and positive way of making sure that the users do not get affected, would be to be responsible and actually test the code before putting it in-front of the users.
- wladimir 15y agoTesting doesn't help if you decide to remove a feature on purpose. Read my post again, would testing have helped Google in this case?
- random42 15y agoNo it will not. That is a business decision anyways. I dont think this is what the post is concerned about. It is about the dead code, developers leave as commented (for some reason), instead of actually deleting it.