Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I mean, Java 8 had the lambdas and FP which I would argue are pretty important in modern Java.

What role do you believe lambdas and support for functional programming play in object-oriented programming courses?



I don’t just see this behavior in OOP style courses.

Most algos classes would probably benefit from streams, and there are many of them being taught in Java for reasons unrelated to OOP. Universities often stick to one language for much of the programming curriculum.


Aren’t lambdas implemented as objects with common interfaces in Java?


To prove two points: First that forcing objects everywhere makes things really complicated compared to FP, second that under the hood everything can be shoehorned to object model.


> First that forcing objects everywhere makes things really complicated compared to FP

Pointless. They are OO courses, not FP courses. You have FP courses already covering that.

> second that under the hood everything can be shoehorned to object model.

You do not need lambdas or FP for that.

So, what's the point of lambdas and FP in a OO course?


Frankly if you want to teach object oriented languages, you should be teaching Smalltalk or Objective C, not things derived from C++. Message passing is the defining feature of object orientation.

If the intent is actually to teach polymorphism and encapsulation, both of those can be done in raw C.


The question is then, why should object oriented languages be taught? It seems to me that for last 25 years or so the true object orientation has been a historical curiosity that inspired polymorphism and encapsulation and only interest for people who want to argue that this and that language aren't true object oriented languages.


Indeed: I wouldn’t bother. Teach procedural and functional programming to undergrads as primary focuses.

However, polymorphism and encapsulation have existed for much longer than “OO” languages. What is stdout? Seems pretty polymorphic to me. How does one gain access[1] to a variable declared in a .c file that is not exposed via the header. That’s encapsulation…

[1]: there are of course ways, but they are often also true of private members of class instances too.


Good point. I was thinking about the C++/Java meaning of the words because that way of doing things has proved to be useful but they're not the only way indeed.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: