4 ms·
As good an explanation for the subject as I've seen. Drive-by repetition of my general curmudgeon opinion: the point at which a real-world software design find
by ajross 8y ago
As good an explanation for the subject as I've seen.
Drive-by repetition of my general curmudgeon opinion: the point at which a real-world software design finds it needs to worry about the specifics of c*variant behavior in its types is precisely the point at which a real-world software design becomes an inappropriate fit for language-based subtyping. Worrying about this stuff hurts rather than helps, if you're trying to solve real problems.
Fight me. As it were.
- rocqua 8y agoDo you consider libraries "Real-world software design"? Because libraries are where this kind of stuff really matters. Getting it right makes your library easily reusable. Getting it wrong makes all reuse a pain.
- ajross 8y agoYou're using "reuse" in a paritucularly narrow sense to mean "usable across the local language's natural type spectrum". And yes, getting that (ahem) "right" is a huge honking pain without careful attention to subtype variance. It's just that you view that as a feature to solve a problem and I view it as a symptom of having tried to solve the wrong problem[1] in the first place. There are lots of ways to have perfectly "reusable" code that doesn't involve subtyping. [1] Because let's be honest: modern "library" code consists of maybe 72% of effort expended on solving the wrong problem.
- rocqua 8y agoI was mostly thinking of e.g. the C++ Standard library, or a TCP library, or a multithreading framework. And really, by re-using that code I mean using the library. Now, most `libraries` don't fall under this category. But for libraries that are truly going to be used, especially if they are used in multiple different organizations, separate from the library writers, then this matters. To your point though, these library writers aren't delivering a what a lot of people think of as a `software product`. I would call it more of an intermediate-product than an end-product.
- zwieback 8y agoThere might be pockets in a software design where it's appropriate to worry about c*variant behavior. However, if you end up with a brittle class hierarchy that affects modularisation, dependency management or reuse then I would agree that using type relationships to model your domain is a losing battle.
- mcguire 8y agoJava Arrays.