This might be true, but you probably have to revisit such code less frequently, and have less of it.
-
-
Replying to @propensive
Not sure which code you mean. I do have less maximally polymorphic code than just plain bad code. My argument is not against maximal polymorphism, but against unnecessary maximal polymorphism. Why abstract over something that is always going to be concrete?
3 replies 0 retweets 0 likes -
Replying to @NicolasRinaudo
Because often the cost of developing the polymorphic version isn't high. When you write the concrete version, and you discover you need similar functionality again, you have a choice between generalizing the first one & updating its call site and writing a new concrete version.
3 replies 0 retweets 0 likes -
Replying to @propensive @NicolasRinaudo
Both of those are less desirable than simply using the polymorphic version you wrote the first time. That's not to say premature generalization is always a good idea: it certainly isn't. But it's not a universal truth that you should do the minimal that solves today's problem.
2 replies 0 retweets 0 likes -
Replying to @propensive
I didn't mean to argue that doing the strict minimum to solve today's problem is always the best way to go, but that always making things as abstract as possible because it might be useful later isn't. It's possible I got lost on the way though.
1 reply 0 retweets 0 likes -
Replying to @NicolasRinaudo
Yeah, I didn't want to make a strawman out of that, because I saw your original point was about "maximally-polymorphic" code. But I wanted to take the opportunity to argue against "doing the minimum possible".
1 reply 0 retweets 0 likes -
Replying to @propensive
Yeah my tweets can clearly be understood to imply that. In a way, I do imply that, it's just that definition of "minimum" might not be the same as yours in this instance :)
1 reply 0 retweets 0 likes -
Replying to @NicolasRinaudo
I know that I prematurely generalize most of the time. I build things for reusability. One thing I think I've got better at with experience is knowing when to do it (and how), and when not to.
1 reply 0 retweets 0 likes -
Replying to @propensive
You might have that talent, and I envy you. Whenever I try to plan for unknown, potential future requirements, my guesses are so badly off that I end up having to undo most of my clever generalisation and start from scratch.
1 reply 0 retweets 0 likes -
Replying to @NicolasRinaudo
That was my early experience. I still make those mistakes, but less frequently (or it takes longer for them to be recognized as mistakes). I think that part of the experience is in knowing and understanding patterns of generalization, and applying them early.
2 replies 0 retweets 0 likes
For example, it's very natural for me to add a type parameter with a new typeclass (and instance) instead of writing a concrete method.
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.