Live data from Hacker News

OOP Is Dead, Long Live OOP

gamedev.net

231–240 of 357 posts

Re: OOP Is Dead, Long Live OOP

#231
post #210

Earlier quoted context omitted.

Except that Rust lacks almost all of the features and terminology you'd expect of an OOP language. Again, I take OOP to mean what one learns in school... A class based language with inheritance, overloading, visibility of members, constructors, etc. Rust can define behavior on any type of data, including scalar values. There is no concept of a "class" and constructors and simple functions that return instantiated val…

> Again, I take OOP to mean what one learns in school Don't do that, then. "OOP" is a term-of-art in an academic discipline. It means exactly what it was used to mean by the people who coined the term in the papers they coined it in. The thing that schools teach under the name "OOP" is a https://en.wikipedia.org/wiki/Lie-to-children intended to introduce something vaguely like OOP, not to introduce OOP itself. --- An…

Most people take "OOP" to mean what schools told them. And that's why "OOP" does mean that. Because most people vaguely agreed on some blurry definition, and use it.

The fact that "OOP" is no longer used to point to what Alan Kay originally meant is immaterial. It's a shame, but that train has passed.

Re: OOP Is Dead, Long Live OOP

#232

Becoming a professional Haskell and Erlang developer really shifted my view on OOP (let OOP denote class based OOP as found in Java or C++). In my view, OOP is prove a poor model for computation, and the result has been that OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functional, or structured paradigm. Recent trends in language design (s…

A poor model for computation that is pervasive in the industry. Poor models usually don't become pervasive.

Qwerty did.

Re: OOP Is Dead, Long Live OOP

#233

Becoming a professional Haskell and Erlang developer really shifted my view on OOP (let OOP denote class based OOP as found in Java or C++). In my view, OOP is prove a poor model for computation, and the result has been that OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functional, or structured paradigm. Recent trends in language design (s…

For some reason 'arguments' against OOP seem to follow a common pattern. You have said many things against OOP, but you haven't actually presented an argument for why it's bad. I'll present each of your assertions here individually to clarify. > OOP is prove a poor model for computation > OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functi…

Bad code is bad code, no matter which language. Languages won't save you from poor design choices.

OOP is popular in large enterprise systems because it (purports to) promote encapsulation and abstraction, which allows many teams/people to interact. Organizations may like OOP because it helps reinforce their drive for independence and fiefdom (see Conway's law https://en.m.wikipedia.org/wiki/Conway%27s_law). Whether it is the best paradigm, the most practical, 'just good enough', the wrong choice is anecdotal. Also, in experience many companies would rather fail conventionally than succeed unconventionally.

Re: OOP Is Dead, Long Live OOP

#234

Earlier quoted context omitted.

For some reason 'arguments' against OOP seem to follow a common pattern. You have said many things against OOP, but you haven't actually presented an argument for why it's bad. I'll present each of your assertions here individually to clarify. > OOP is prove a poor model for computation > OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functi…

The pattern you talk about is mainly a product of not wanting to squeeze a whole essay into an HN comment. I also suspect the problems with OOP are hard to communicate. I for one always had a problem with OOP, but I could never quite point it out. Sure, when faced with an OOP design, I could almost always find simplifications. But maybe I never saw the good designs? Maybe this was OOP done wrong? I do have reasons to…

> The pattern you talk about is mainly a product of not wanting to squeeze a whole essay into an HN comment.

That may very well apply to the GP's comment—but, my observation of the pattern is derived from a mix of mini-essay comments, and articles people are writing on Medium or their blogs or whatever, where the space constraints aren't so tight.

There are a couple things you'll regularly find: laughably bad straw-men (GP is free of these), overly vague statements that only survive scrutiny because of their vagueness (e.g. when the GP says OOP produces "abstractions that do not easily model computation"), and unjustified claims.

The net effect is something that sounds bad, but if looked at closely carries very little force.

I suspect the reasons for it are:

1) Actually evaluating a language paradigm is more difficult than these folks suspect. Their view matches their experience and they assume their experience is more global than it really is. Additionally, we don't have a mature theoretical framework for making the comparisons.

2) People are arguing for personal reasons. They have committed themselves to some paradigm and they want to feel secure in their justification for doing so.

Re: OOP Is Dead, Long Live OOP

#235
post #219

Earlier quoted context omitted.

For some reason 'arguments' against OOP seem to follow a common pattern. You have said many things against OOP, but you haven't actually presented an argument for why it's bad. I'll present each of your assertions here individually to clarify. > OOP is prove a poor model for computation > OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functi…

I upvoted you. Why OOP is bad: In 8 years professional (for money) programming experience i had zero use cases for OOP. Every time I tried to use OOP it backfired and I abandoned it. Maybe I just never really understood OOP or maybe I already use OOP all the time without calling it OOP.

What were the types of problems and systems you have worked on? Which languages and programming styles (eg functional) did you end up using to solve them?

Re: OOP Is Dead, Long Live OOP

#236

Earlier quoted context omitted.

You are confusing inheritance of implementation with inheritance of interface. The consensus is to use inheritance of interfaces and use composition to implement the interfaces. Hence my phrasing: "Inheritance is better achieved through composition".

But you still use the OOP concept of inheritance, which is basically "indirect methods with function pointers". Beside, "interfaces" don't even exist as a syntaxic concept in many OOP languages, C++ being the most prominent one.

That's splitting hairs. Regardless of the syntax mechanism used to achieve it, inheritance of interfaces and inheritance of implementation are qualitatively different, in the sense that you can usually tell the difference regardless of language.

Also, C++ has abstract classes with only pure virtual functions, which accomplish the same thing.

Re: OOP Is Dead, Long Live OOP

#237
post #219

Earlier quoted context omitted.

For some reason 'arguments' against OOP seem to follow a common pattern. You have said many things against OOP, but you haven't actually presented an argument for why it's bad. I'll present each of your assertions here individually to clarify. > OOP is prove a poor model for computation > OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functi…

I upvoted you. Why OOP is bad: In 8 years professional (for money) programming experience i had zero use cases for OOP. Every time I tried to use OOP it backfired and I abandoned it. Maybe I just never really understood OOP or maybe I already use OOP all the time without calling it OOP.

My main conclusion on the subject is that it really depends on what domain you're coding in.

There are plenty of applications I would never use OOP for. I use Elixir for my backend work. I tend to use OOP for interactive simulation/game sorts of applications.

Re: OOP Is Dead, Long Live OOP

#238
post #131

Earlier quoted context omitted.

A poor model for computation that is pervasive in the industry. Poor models usually don't become pervasive.

The engineering organization where I work is full of dysfunction. This is because numerous poor practices were ignored or encouraged over the years. Now there is strong inertia against change because the incompetent long-timers know all the tricks and manage their job security through the system as it is. This is not uncommon especially in the Bay Area.

What does the software or company do? For example, do they make software for accountants? Construction?

Re: OOP Is Dead, Long Live OOP

#239

Becoming a professional Haskell and Erlang developer really shifted my view on OOP (let OOP denote class based OOP as found in Java or C++). In my view, OOP is prove a poor model for computation, and the result has been that OO code is almost always significantly more complex and error prone than an equivalent computation written in a concurrent, functional, or structured paradigm. Recent trends in language design (s…

My personal anecdotal experience is that OOP lends itself well to very very large codebases. A language like java with packaging, classes, and encapsulation strongly encourages some meaningful organization. Even if that organization is implemented poorly by the user, it's better than what I have seen users create in the real world with languages like C. If you have a project where a single person could reasonably und…

Have you tried something with typeclasses, ADTs, or some form of interfaces? C really doesn't provide any tools to make abstractions and lacks the basics, like namespaces.

My experience with OOP is that it generally drives people to very large codebases that are hard to reason about at scale. Usually it brings in a framework of some sort to manage the complexity of wiring objects together in a manageable way. For example, Java Spring uses annotations to magically wire objects together.

Re: OOP Is Dead, Long Live OOP

#240

Earlier quoted context omitted.

If you use a typical IDE that comes with Squeak or VisualWorks, you can quickly inspect a lot of idiomatic code from the standard library. The most common mistake I have seen is that people who know about other programming languages, start looking at OOP as a way to separate and organize code. Instead, it starts from the other side: OOP is based on a few core concepts, and those concepts are critical to understanding…

Thanks for your reply. Where would you go to "to understand the concept-side of it" better? I am reasonably fluent in Java and Python, and read a lot of C/C++. So I think I have a solid understanding what OO looks like, and what concepts are involved (dynamic dispatch, polymorphism, inheritance, etc). However, there is a lot of critique about the OO models in these languages and code that is found in the wild. What I…

The professor who taught me OOP wrote a book which I never read, but I am confident that he focuses on the concepts in the beginning: https://books.google.de/books?id=RAloBgAAQBAJ&printsec=front...

Another good source of ebooks seems to be this page: http://stephane.ducasse.free.fr/FreeBooks/

There you can find the Blue-Book which looks like a great resource too:

http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook....

Some Links seem to be broken nowadays, but some content can be obtained from the archive: https://web.archive.org/web/20130319110836/http://stephane.d...

Post reply on HN