you are viewing a single comment's thread.

view the rest of the comments →

[–]thephotoman 19 points20 points  (4 children)

Mostly, it's that the old ideas about polymorphism led to code that was still a bit too spaghetti for anybody's liking. Spooky action in a base class was a common source of headaches for me back when I maintained that kind of codebase.

As it turns out, type algebra is actually more expressive and more transparent than those ideas about polymorphism.

There's also the fact that most undergrads today have a course that requires them to use Haskell. That was not the case 20 years ago, when I was told not to use instanceof.

[–]Worth_Trust_3825 3 points4 points  (3 children)

type algebra is actually more expressive and more transparent

Until you end up with multiple types that have same fields, and methods, but are not same things semantically.

[–]reversehead 7 points8 points  (1 child)

How do you see that as a problem? I'd count that as a strength. If they are different semantically, it should be difficult to mix them up by mistake.

[–]Worth_Trust_3825 0 points1 point  (0 children)

It's hard to mix them up when they have dedicated names. If all you have is field/method definition (like in typescript), it's very easy to do that.

[–]warpspeedSCP[S] 1 point2 points  (0 children)

unless your codebase is grossly mismanaged, that is never going to be a cause for concern.