Live data from Hacker News

Ask HN: Why do new(ish) programming languages eschew OOP features?

news.ycombinator.com

131–140 of 234 posts

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#131

Many systems people want to build with computers cannot be easily conceptualised as graphs of largely self-contained objects, interacting through swapping messages. These problems instead revolve around complex data processing, and are more easily conceptualised as data flowing through a network of functions, and into and out of containers. It is possible to build these systems using OO, by reifying the network of fu…

This answer is very, very good.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#132
post #123

You would have to ask the authors of those languages but I do not find it very surprising. If you take the whole set of features that commonly comprises object-orientedness it is a rather large set that also seems a bit arbitrary. Why would the same language construct known as a class support inheritance and static members and data hiding? Those are orthogonal things. It seems as such more logical to provide these an…

Good point, I've never thought of it that way before.

You've heard of the "God-class" anti-patern. Java style classes are a "God-abstraction".

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#134

Earlier quoted context omitted.

R was used by statisticians, but python was used by every non-cs researcher who needed something more than matlab. Python didn't beat R because it's OO. It won because of its existing popularity (with many people learning it in their intro programming class) and the massive amounts of open source software built for it. > People just don't have enough experience with Functional Programming to really know how awful it…

> Python didn't beat R because it's OO ... My point that it beat R although it is OOP. This is to show that OOP is not inherently bad. Many people find it useful to the point the 'preserved' advantages of FP are not worth the effort. > This is just anecdotal ... My anecdote story is very different than yours. To the point if one of my engineers will ever suggest FP again he will get fired on the spot.

> To the point if one of my engineers will ever suggest FP again he will get fired on the spot.

If you are going to react so disproportionately to the mere suggestion of FP, I am sorry, it is difficult to take your anecdote or opinion seriously.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#135
post #81
post #30

Earlier quoted context omitted.

Open recursion is pretty much core to the most useful OOP idiom, which I would assert is UI component toolkits. UI heavily relies on a large number of conventions that the user learns to expect to cat in certain ways. You can parameterize a UI widget that encapsulates these conventions with function pointers or overridden methods, but the end result is pretty much the same. I'll strongly agree however that far too fe…

When the goal is to model something “in real life” OOP tends to map decently well and it’s easy to teach. When you’re trying to make sure your program isn’t going to go off the rails, limits on mutation is one of the first places to look. When your software has 50mm+ valid states, one should hopes they have a large manual QA team. If you have all the possible states held in their own subsystem, you can automate stabi…

Why is modelling in OOP any more "real life" than with other programming paradigms? I've heard this many times from OOP zealots but I just don't get it. Most examples of this I've seen focus on physical objects such as cars which is just ludicrous as your average piece of software is morel likely to be dealing with a data structure, such as a user profile, than anything physical.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#137
post #67

Earlier quoted context omitted.

I disagree with it being OO when it doesn’t have inheritance. No classes or class hierarkies, no passing things along to children. Seems very different than what those who invented OO had in mind. Structs with functions attached is easy, and not entirely uncommon in procedural and even functional languages.

Interfaces are inheritance, just without code. But interfaces definitely serve at least one role of an abstract base class.

Maybe. But then even FP languages are considered OOP, as most of those languages have records and interfaces.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#138
post #72
post #62

Earlier quoted context omitted.

We don’t have more FP languages than OOP languages, and several languages that are considered FP have their own implementation of OOP (OCaml, Common Lisp...) in addition, several OOP languages are now implementing classic FP features like lambdas and pattern matching. Also, the question asked doesn’t actually care about FP. Go isn’t a functional language, bit neither is it OO.

Go lets me do enough object oriented programming to keep me more productive, while not creating a pile of confusion. Sadly, there seems to be almost no functional programming concepts supported that I'd use (map, filter, reduce, lambdas). I think the lack of generics and operator overloading might have something to do with that?

Yes. I’d assume those would come rather quickly once generics are added.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#139
post #62

Earlier quoted context omitted.

We don’t have more FP languages than OOP languages, and several languages that are considered FP have their own implementation of OOP (OCaml, Common Lisp...) in addition, several OOP languages are now implementing classic FP features like lambdas and pattern matching. Also, the question asked doesn’t actually care about FP. Go isn’t a functional language, bit neither is it OO.

You are right, it should have been a comment to another person on this thread. Not the OP. My point regarding the number of FP languages that it is not a silver bullet, neither is OOP to be sure, but FP has its own set of problems hence the many different implementations. Regarding OOP languages implementing classic FP features, which is true and a blessing! These are good features which IMHO gives more credit to OOP…

Regarding number of languages, I don’t agree that it signifies a problem. For instance, F# doesn’t exist because OCaml is bad, but because there was room for a functional language with good interop with .NET. Same story with Clojure vs Common Lisp.

Making a new language doesn’t automaticly imply that some other language got something wrong.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#140
post #121
post #109

Earlier quoted context omitted.

Here you can find a series of blog posts discussing why OOP is not a good fit for games: https://ericlippert.com/2015/04/27/wizards-and-warriors-part...

I've read these before, they're great (and I'm going to read them again now for fun. :) That said, "let’s write some classes without thinking about it!" pretty much sums up the criticism of OOP. You can't just throw your problem domain naively at some language structures and then blame the language when it doesn't work. I bet I could pick any programming paradigm and find a way to do it wronger than this. (If I were…

[deleted]
Post reply on HN