Live data from Hacker News

OOP Is Dead, Long Live OOP

gamedev.net

31–40 of 357 posts

Re: OOP Is Dead, Long Live OOP

#32
post #27

Earlier quoted context omitted.

> OOP is just a mental model. Deep down everything is made of bits. The church of OOP has failed but if something looks like a duck, walks like a duck and talks like a duck it probably is useful to make a duck class. We're now down to fighting for nuances. No... I think this is missing precisely what was exactly the point of the article (see "(B)" in the text). This post is not a fight over OOP religion. The point of…

Just because prior literature exists, does not mean it should not be superseded. For example, generics wasn't even a thing when OOP originally started and yet LINQ and basic list ADT's wouldn't be as powerful without it.

> Just because prior literature exists, does not mean it should not be superseded. For example, generics wasn't even a thing when OOP originally started and yet LINQ and basic list ADT's wouldn't be as powerful without it.

No, this not an example... generics did not "supercede" OOP.

Re: OOP Is Dead, Long Live OOP

#33
post #22

OOP is just a mental model. Deep down everything is made of bits. The church of OOP has failed but if something looks like a duck, walks like a duck and talks like a duck it probably is useful to make a duck class. We're now down to fighting for nuances. You can do most things with OOP or without OOP but each path has some upsides and downsides and most of the time it's good to use some things it provides where it ma…

How has the church of OOP failed? Nearly every used language is based almost entirely on OOP. OOP makes organizing software and code reuse incredibly easy. The only real downsides to OOP is that its arguably slower and has more overhead. But that's only a problem in niche applications (ie. embedded apps).

It failed by teaching that every data structure should be put into classes using many levels of inheritance, interfaces, encapsulation, accessors and the whole shebang when the thing really is just a plain old integer. OOP is really useful and powerful in many areas and applications but it is not the only tool that has to be used for everything.

Re: OOP Is Dead, Long Live OOP

#34

OOP is just a mental model. Deep down everything is made of bits. The church of OOP has failed but if something looks like a duck, walks like a duck and talks like a duck it probably is useful to make a duck class. We're now down to fighting for nuances. You can do most things with OOP or without OOP but each path has some upsides and downsides and most of the time it's good to use some things it provides where it ma…

>The great architect has the foresight on how the code will be used in five years and design it accordingly. Isn't he better off taking that crystal ball that gives him the foresight, using it to pick the correct lottery numbers and simply retiring?

Predicting position and velocity of little plastic balls tumbling inside some rotating container is a very different problem to predicting the behaviour of future API consumers. Specially if those consumers work in the same company you do and have shared objectives.

So no, he's not better using that "crystal ball" to predict the lottery.

Re: OOP Is Dead, Long Live OOP

#35
post #22

OOP is just a mental model. Deep down everything is made of bits. The church of OOP has failed but if something looks like a duck, walks like a duck and talks like a duck it probably is useful to make a duck class. We're now down to fighting for nuances. You can do most things with OOP or without OOP but each path has some upsides and downsides and most of the time it's good to use some things it provides where it ma…

How has the church of OOP failed? Nearly every used language is based almost entirely on OOP. OOP makes organizing software and code reuse incredibly easy. The only real downsides to OOP is that its arguably slower and has more overhead. But that's only a problem in niche applications (ie. embedded apps).

There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.

OOP-based languages are certainly more common, but definitely not the only game in town. Clojure, Erlang, Lisp, Perl 4, Forth, Fortran, Haskell...

Re: OOP Is Dead, Long Live OOP

#37

Author needs to actually state what ECS is. From context I don't think he/she is referring to Amazon's Elastic Compute Service.

It refers to Entity-Component-System, an architectural design pattern (like Model-View-Controller) that uses composition instead of inheritance to define the behavior of entities in a simulation.

> that uses composition instead of inheritance

What they are referring to as ECS is more than just composition over inheritance. There are entity component architectures that are just that--Unity's existing class based component architecture for example.

But the ECS in this case refers to Data Oriented Design--basically laying out data like normalized database tables. Every component system has a table, and each row in the table is the data for one component (you don't actually use a relational DB for this, the data is just organized in a similar manner). The entity itself is just an id that all of the components reference.

The concept as used in games started in the late 90s as Structs of Arrays instead of Arrays of Structs.

Here's a a good free book on the subject (there's a paid hard copy as well) http://www.dataorienteddesign.com/dodmain/

Re: OOP Is Dead, Long Live OOP

#39

OOP is just a mental model. Deep down everything is made of bits. The church of OOP has failed but if something looks like a duck, walks like a duck and talks like a duck it probably is useful to make a duck class. We're now down to fighting for nuances. You can do most things with OOP or without OOP but each path has some upsides and downsides and most of the time it's good to use some things it provides where it ma…

I kind of like the way D handles oop. D gives you structs, classes and interfaces.

Structs are stack allocated and have no inheritance. But are otherwise syntactically work like classes.

Classes are heap allocated and allow single inheritance, unless the parent is an interface.

Interfaces are similar to a class but it's member functions must be overridden. A class can inherit from multiple functions.

I tend to use a mix of these and templates depending on the type of data i'm handling. I find it gives the best of whatever design pattern works well for different parts of a project without locking you into a certain paradigm throughout and still keeping everything fairly logical and coherent to read through and understand.

Re: OOP Is Dead, Long Live OOP

#40
post #20

I’d be very wary of hiring an ”OO” dev who can’t reasonably formulate what the SOLID principles are and why they exist.

Even Solid, like OOP is one of those concepts that has morphed more into an ideology than it needs to be with blind faith adherents

https://speakerdeck.com/tastapod/why-every-element-of-solid-...

I'll take someone who writes simple code that can be easily changed 101 out of 100 times over a SOLID, OOP Adherent.

Post reply on HN