News for hackers. Stuff that matters.
Re:Classes are a way of writing higher order functions by loup-vaillant on Wednesday September 09, 2020 @01:08PM (#24423158)
> OOP won against functional because OOP is easier to understand and leads to more maintainable code.

A couple points:

I'm not sure whether OOP really won: pretty much any language now has taken lambdas & higher-order functions from FP; before those parametric polymorphism (ML was there before C++ templates and Java generics); many sources will tell you to limit mutable state; and even algebraic data types are starting to get mainstream traction (Rust). Speaking of which, I believe Rust does not sell itself as an OOP language?

It is not at all obvious that OOP is easier to understand. Those animal/shape hierarchies are indeed very easy to grasp, and they are also useless. Even games have moved away from class hierarchies, which are both slow and too inflexible. They're more about ECS/data orientation now.

I'm not sure that "easier to understand" does lead to more maintainable code either. If you're talking about daily use, why not. If this is a learning curve thing (and in practice I suspect it is), then I think ease of learning and code quality won't correlate with each other — provided only people who learned the stuff get to program with it of course.

Re:Classes are a way of writing higher order functions by pintxo on Wednesday September 09, 2020 @01:25PM (#24423386)
> Those animal/shape hierarchies are indeed very easy to grasp, and they are also useless.

That's a wonderful description.

Re:Classes are a way of writing higher order functions by narwally on Wednesday September 09, 2020 @02:03PM (#24423868)
As someone that had some background in cladistics, I knew OOP was gonna get real complicated as soon as I saw animal hierarchies as a 'simple' example.