Live data from Hacker News

Object-Oriented Programming is Bad (2016) [video]

m.youtube.com

41–50 of 133 posts

Re: Object-Oriented Programming is Bad (2016) [video]

#41

I've seen this posted here before. I take issue with anyone who gets onto a soapbox and announces "this might be the most important video you've ever watched" and then proceeds to espouse their opinion about something. It's egotistical and it immediately sets up any dissenting opinions as Obviously Wrong. I call BS on all of it. OOP can be written well. I've done it. I've seen it done by others. When you need a stron…

I think one of the reasons anti-OOP opinions are so strong is that OOP was promoted as the end all savior of programming. At my University it was dogmatically emphasized. "OOP" (e.g. subtype polymorphism) is useful for some problems, but worthless and kludgy for others; it's a hammer pounding lagbolts. A generation of programmers (mine) missed out on the richness of Lisp/ML flavored languages. I didn't really come to…

interestingly Lisp/ocaml/clojure rank low in popularity, clojure shows it’s not because of libraries. That has to mean something other than libraries or unenlightend people. Idk maybe there is too much complexity in those languages and philosophy

Re: Object-Oriented Programming is Bad (2016) [video]

#42
post #26

I've seen this posted here before. I take issue with anyone who gets onto a soapbox and announces "this might be the most important video you've ever watched" and then proceeds to espouse their opinion about something. It's egotistical and it immediately sets up any dissenting opinions as Obviously Wrong. I call BS on all of it. OOP can be written well. I've done it. I've seen it done by others. When you need a stron…

This advice/reflection could apply equally to any style of programming, except for one particular snippet. You haven't made or refuted any OOP-specific claims. Separation of concerns? Egotistical soapbox speaker? Strong domain layer? What do they have to do with OOP, as opposed to just P? Except for this: > favor composition over inheritence Yes! Inheritance is OOP-specific, and I agree that you should avoid it.

But why? Why avoid inheritance?

Re: Object-Oriented Programming is Bad (2016) [video]

#43

In my experience, the thing that's wrong about object-oriented programming is not the object-orientation itself, but the over-application of it. - Sometimes more "procedural" programming provides better clarity. At other times, object-orientation is a cleaner approach. Neither should be a replacement for the other at all times. - The idea that objects should reflect how we think of real objects in the physical world…

Well duh. We’ve been sold object oriented platforms for decades with the insistence that everything is an object, hiding its internals from the world. There was tepid support for representing plain data. At the heyday of the madness people were busy building object-over-network abominations like CORBA. Even today, the most popular enterprise platform, Java, does not support value types. In the free world, the widely used Python platform has added dataclasses only as recent as 3.7, the current version. No wonder OO style is widely overused.

Re: Object-Oriented Programming is Bad (2016) [video]

#44

It is quite obvious to me that the author is ignorant on the history of computing. The reason of the popularity of OOP is way longer than java, Xerox invented the graphical desktop and ALSO OOP. When Steve Jobs was ousted from Apple he created NEXT because he believed OOP was the next big thing. It was, and it became the foundation of MacOS X. Microsoft copied Steve Jobs in Windows with MFC. Java copied all of them.…

Functional programming has little impact on performance.

Probably talking about Java’s implementation which takes a while to warm up

Re: Object-Oriented Programming is Bad (2016) [video]

#46
Where does Domain Driven Design fall? DDD typically has service class that operates on multiple business objects in a pipe-line like fashion. Being business programming, there is always side-effects but usually handle via repository or db manager classes. I.e. no active record.

Re: Object-Oriented Programming is Bad (2016) [video]

#47
Brian's video is one of the most influential bits of wisdom I've received in my career. Up until this video I did not have a language for explaining the problems I ran into trying to build OO systems. It also helped me understand why writing procedural-functional code felt so natural and easy.

I was a die hard OO/UML guy. I even contributed to various open source software projects for a model-driven-architecture framework, a UML editor, and integrations with Rational Rose. I was an evangelist for good OO practices, SOLID, etc... As a development coach I was quite fervent.

Looking back on that I feel like a fool. When I read the code refactoring examples from Uncle Bob and others I see all the problems Brian talks about in his video (and more). OO was a nice idea but we got the granularity and implementation wrong.

Re: Object-Oriented Programming is Bad (2016) [video]

#48
post #12

Earlier quoted context omitted.

Except it's not unfashionable. It's used by millions of programmers who just want to get stuff done. It's used by thousands of companies who don't really care how the native instructions are eventually generated. It's used by individuals and teams, application developers and library authors. This premise of this video is flawed from the beginning and the whole thing is basically a gigantic straw man.

He has reduced OOP to polymorphism/encapsulation/inheritance. Is that what you mean by the straw man?

He specifically says inheritance and polymorphism are irrelevant in the video. His problem is with poor encapsulation which is not specific to OOP.

Re: Object-Oriented Programming is Bad (2016) [video]

#49
post #14

The problem for me in regards to OOP is the complexity related to the management of state. OOP encourages mutability and understanding the state of an object as its methods are called can be confusing when additional internal (and often times, private) methods are called. In functional programming, state is something acted upon by functions. It is as simple as f(x) = y. Reasoning in functional programming is much clo…

In theory this sounds great but in reality every major application, game, operating system and even website is written in an OOP style. Why is that? People should first answer that question.

Yeah, real existing software has flaws like every other thing in reality but at least it exists unlike a significant piece of fp style software. I like fp and I think it has a lot to teach but I think it's a bit presumptuous to advocate against a major paradigm that has actually proven itself with one that has failed to do so for decades.

And if OOP is so horrible why do so many people write OOP style PHP and javascript where they really don't have to?

Personally, I don't think OOP is bad per se, I just think the type systems of the main OOP languages are too limited and inflexible. Even so, you can accomplish amazing stuff in them. Just look at the Spring Framework and what it helps you do with so little code.

Re: Object-Oriented Programming is Bad (2016) [video]

#50
post #26

Earlier quoted context omitted.

This advice/reflection could apply equally to any style of programming, except for one particular snippet. You haven't made or refuted any OOP-specific claims. Separation of concerns? Egotistical soapbox speaker? Strong domain layer? What do they have to do with OOP, as opposed to just P? Except for this: > favor composition over inheritence Yes! Inheritance is OOP-specific, and I agree that you should avoid it.

But why? Why avoid inheritance?

if done improperly one ends up having to maintain backward compatibility in the parent object not just on the actual interface but also in the internal state. basically makes it too easy to violate incapsulation

one needs not to avoid it completely but need to be aware of the pitfalls

Post reply on HN