6 ms·
From the article: "I also must confess to a strong bias against the fashion for reusable code. ... you’ll never convince me that reusable code isn’t mostly a me
by binglo 18y ago
From the article: "I also must confess to a strong bias against the fashion for reusable code. ... you’ll never convince me that reusable code isn’t mostly a menace."
???
- jrockway 18y agoKnuth is solving different problems than Joe Average programmer. I don't think anyone will argue against reusing existing databases, web frameworks, etc. when you are writing a web app. But if you are, say, writing a new typesetting system... who cares about reusability? You just need to make it work. The components aren't typically used elsewhere in that case, so your priority should be writing a good typesetting system, not writing reusable parts. I think that's what he's saying, anyway...
- mironathetin 18y agoYou left out the explanation of Knuth: "To me, "re-editable code" is much, much better than an untouchable black box or toolkit." This is how I understand it (and how I use it): I always try to improve and write my code more elegant and more adapted to the problem I want to solve. Old code is always the basics that I copy and edit to make it fit into a new and improved environment. Generic pieces of a library that have been used in many places cannot be modified without very expensive investigation of the consequences on existing code. These investigations are not only boring and time consuming. If they exist (always!) you just limit yourself. Thats because you have to solve your problem AND keep in mind not to harm existing code. This is not what writing software should be about. Patterns like the decorator may be a way out sometimes. But if used too extensive the resulting code will be too ugly for my taste.