Had to work with some code I wrote a few years ago where I went maximally polymorphic for the hell of it - it was just as painful as when working with badly documented and poorly tested dynamically checked code.
It really has to be a balancing act: how reusable can you make the first implementation? How likely is it that you'll need it? How difficult is it? How opaque will the implementation be?
-
-
*This*, on the other hand, is what I mean. Each approach has its own trade-offs, and you need to decide which is appropriate for each situation. I tend to err on the side of readability because I spend more time reading code than writing it, but that's entirely personal.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I think writing highly generic code is challenging, fun and motivated mostly by personal enjoyment. The reaction to that is to outlaw it. But I think it's the reason why there's so much code in existence, which creates a huge space for bugs to hide.
-
I absolutely agree with your first sentence but don't understand why it leads to the second one. Knowing you, there *must* be a logical reason I'm not seeing. Would you mind filling in the bits?
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.