logoalt Hacker News

mattgreenrocks11/08/20241 replyview on HN

Everyone lands at a different spot.

Personally, I don't want to write any new code in something that doesn't have ADTs, or the moral equivalent (Java's sealed classes). I've already written a lifetime of code without them, so I suppose part of that is not wanting to write another 20 years of the same code. :)


Replies

grey-area11/08/2024

If you don’t like subclasses changing code, isn’t inheritance the real problem?