Live data from Hacker News

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

news.ycombinator.com

51–60 of 234 posts

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

#51
post #49

Object oriented programming doesn't really fit every problem. It really seems more strange that it took so long for us to see some alternatives. I mean, it took over programming like a revolution, like structured programming, but structured->OO doesn't have anything nearly like the benefits of unstructured->structured. It seems like a good paradigm for a couple of problem domains, but IMHO, it got cargo-culted on to…

One thing I think is OOP works pretty well for GUI type programs. But has little advantage when building networked service infrastructure. So during the desktop era OOP was ascendant. Now we're in a distributed data processing/storage/retrieval/service era. In particular data is ephemeral and not 'owned' by a particular service. So it doesn't make sense to start attaching local methods to it.

OOP for GUI is getting old fashioned I think. I am thinking about the class-based imperative frameworks in Java/C#.

Just look at the functional components and hooks in react.

They have just abandoned the class based syntax.

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

#52
A new language is in part to discover a new place in the space of languages that isn't already well represented. OOP has been done since Smalltalk-80 and many of the class-based languages that followed. Deep class hierarchies worked well for developing widget trees and not much else. Now we're looking for a different trade-off since the constraints of hardware are different than before. Immutability performs well with multicore we have enough memory and advanced gc to not need to reuse mutable objects to conserve memory. Working in a mostly functional style with few key places of reference updates to large structures are much more clear and debuggable.

Many of the newer languages are multi-paradigm trying to find a sweet spot that either takes the best of each and add something new or tries to capture a large audience with features.

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

#53
post #5

Unpopular answer: pure fashion. There's nothing wrong with object methods (that's 100% pure syntax vs. a function call) and an implicit "this" scope for symbols (which is just a limited form of dynamic scope[1]). They don't make code hard to understand. OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax. Non-syntactic aspects are maybe a more involved discussion. For an exa…

Pure fashion? I think that's a bit much. Rust was inspired heavily by ML/Haskell/C++, which are not particularly object oriented (C++ is object friendly, not object oriented).

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

#54
post #5

Unpopular answer: pure fashion. There's nothing wrong with object methods (that's 100% pure syntax vs. a function call) and an implicit "this" scope for symbols (which is just a limited form of dynamic scope[1]). They don't make code hard to understand. OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax. Non-syntactic aspects are maybe a more involved discussion. For an exa…

The most upvoted answer begins with the words “Unpopular answer” and then continues with cynicism. That definitely feels very HN. (No offense, of course; just found it amusing.)

Although you make some good points, I disagree with the premise that it’s pure fashion. Language syntax doesn’t prevent you from implementing various OO paradigms but when you combine syntax with community norms, things do tend to be constrained. Nobody does traditional inheritance in Go, for example, which actually tends to work out well in use cases where it’s popular.

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

#55
post #5

Unpopular answer: pure fashion. There's nothing wrong with object methods (that's 100% pure syntax vs. a function call) and an implicit "this" scope for symbols (which is just a limited form of dynamic scope[1]). They don't make code hard to understand. OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax. Non-syntactic aspects are maybe a more involved discussion. For an exa…

Unpopular answer to the unpopular answer: OOP was pure fashion

.. “Our customers wanted OO prolog so we made OO prolog” .. http://harmful.cat-v.org/software/OO_programming/why_oo_suck...

.. screw things up with any idiotic "object model" crap. .. http://harmful.cat-v.org/software/c++/linus

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

#56
post #55
post #5

Unpopular answer: pure fashion. There's nothing wrong with object methods (that's 100% pure syntax vs. a function call) and an implicit "this" scope for symbols (which is just a limited form of dynamic scope[1]). They don't make code hard to understand. OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax. Non-syntactic aspects are maybe a more involved discussion. For an exa…

Unpopular answer to the unpopular answer: OOP was pure fashion .. “Our customers wanted OO prolog so we made OO prolog” .. http://harmful.cat-v.org/software/OO_programming/why_oo_suck... .. screw things up with any idiotic "object model" crap. .. http://harmful.cat-v.org/software/c++/linus

I don't see that follows. The flood of OO languages in the early 90's went hand in hand with a very broad reorientation of the way design was done. That that had bad side effects isn't really a rejection of the fact that OO design really was a fundamentally different way of thinking about problems, and languages that supported it syntactically were doing so to enable this paradigm shift. That's not really "fashion" in the sense that I meant.

On the flip side, the modern language zeitgeist isn't really trying to change things in fundamental ways, except to say "don't do bad OO". But you don't need to reject OO syntax and features (c.f. polymorphism above) to reject bad OO. That part is fashion.

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

#57
post #21

Depending on who you ask, "trend" could be replaced with "progression". I'm with you in that I never really found the OOP style to mesh well with my brain. I always felt like I had to fight it and dealing with massive chains of class inheritance can make it really hard to reason about and change code. I've spent years building web apps with Python and Ruby too. Having only spent a short while with Elixir, I'm finding…

I would think more than 2 layers of inheritance is a major code smell in any language let alone Python. There is surely a way that inheritance chain could be broken down to make more sense.

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

#58

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 is such an awesome answer.

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

#59
post #5

Unpopular answer: pure fashion. There's nothing wrong with object methods (that's 100% pure syntax vs. a function call) and an implicit "this" scope for symbols (which is just a limited form of dynamic scope[1]). They don't make code hard to understand. OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax. Non-syntactic aspects are maybe a more involved discussion. For an exa…

I don't think the problems with the "classic OOP languages" like Java, C#, C++ and Python stem from the objects themselves. IMO it's the implicit mutability and lack of actual type safety (even for typed languages) that the new crop is trying to solve. And with functions it's more explicit and not "just doing the same thing better". This way it's probably easier for adoption, as people explicitly adopt "new ways" to do things in a "better way"

I agree it's fashion to some extent, and still could be done with OOP, though I think it's nice we are doing it this way (for the above reasons).

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

#60
People just don't have enough experience with Functional Programming to really know how awful it is. So now it is the new kid on the block (in terms of going mainstream) so people think it is the best thing ever.

The most telling sign is how many FP languages are in existence today. If it was such a good thing we wouldn't need them all. It is a mess that cause many other types of problems without any clear benefit.

I do get that many people like the FP paradigm, no two humans are alike and people will find different ways of thinking and reasoning about a problem more suitable. Which is OK. BUT it doesn't mean FP is a any better than OPP or vice versa.

Last I would like to point out how Python (OOP) obliterated R (FP) it the Data Science market although R enjoyed a head start of few years and was the Franca Lingua of statisticians.

Post reply on HN