16 ms·
The Repeated Deaths of OOP (2015)
- nailer 5y agoAs the article mentioned the meaning of OOP changed over time. Alan Kay has a description of OOP that sounds like the actor model used in erlang/elixir or mq and consuming services elsewhere.
- ProfHewitt 5y agoSmalltalk evolved over time. Is Smalltalk in 1972 an OOP programming language?
- Rochus 5y agoProbably yes, if you ask Dr. Kay, probably rather no, if you ask other programming language authors. It e.g. lacks inheritance and some other OO features present e.g. in Smalltalk-80. But I guess the question was rethorical anyway.
- Rochus 5y agoThis is an opinion piece from 2015. It goes without saying that there are no universal standard solutions. As an engineer, you learn how to proceed in a structured and systematic way and (hopefully) apply appropriate methods and technologies that fit the problem at hand. ECS is a good approach and there are many problems where this is a good fit; however, there are also problems where it is a less good fit. The same applies to OOP and all other methods of software engineering.
- yakubin 5y agoThe article doesn't argue that ECS is a good fit for everything. It argues that it is a better fit than OOP for some of the things OOP was intended for. And that it's a broader theme, where OOP is usually not the right tool for the job, even when it was originally intended to solve that particular job.
- Rochus 5y agoThe article is primarily trying to suggest that "OOP" has "died" so many times that it should no longer be used. As if OOP was an ideology to be committed to or not.
- girvo 5y agoThat is not what I took from the article at all.
- meheleventyone 5y agoIt does a poor job of this in light of component based OOP approaches.
- ehnto 5y agoI'm confused. ECS is a type of OOP, is it not? An entity is an object in the same way a model is an object.
- tsimionescu 5y agoI think one of the most core ideas of OOP is encapsulation, and in this way ECS is radically opposed to OOP.
- ratww 5y agoNot really. An "Entity" in most modern ECS implementations is normally implemented as an integer, which is used as a handle to which multiple components refer to. A "Component" is normally implemented as a struct, and a "System" as a standalone function. No encapsulation here. Of course you would have to implement all of the above using classes and objects if your language doesn't have support for structs or standalone functions, but that's just an implementation detail. The concept itself is not a subset of OOP, and breaks many "rules" of OOP.
- 310ke 5y agoAll engineering and technical tasks really. I was taught to think of learning these techniques as putting tools in my toolbox. Then when a situation arises I can select which tool I think might be the best fit. No ideology, no cargo-culting, just get it done.
- phoe-krk 5y agoRegarding lambdas and closures, it's not really a blow to OOP - it's simply another interpretation of methods and fields. As the famous koan[0] said, "objects are just a poor man's closures". [0] https://blog.ploeh.dk/2018/01/22/function-isomorphisms/ https://blog.ploeh.dk/2018/01/22/function-isomorphisms/
- valenterry 5y agoThe article clearly shows that using the term OOP without further explanation is not helpful at all, rather confusing, because everyone has a different understanding. Compare that the "functional programming" which in comparison has a glas clear definition, which makes it much easier to decide if some program is "pure functional" or not, avoiding prolonged and unproductive discussions.
- Rochus 5y ago> "functional programming" which in comparison has a glas clear definition Does it?
- ebingdom 5y agoI would say it doesn't have a formal 100% unambiguous definition, but it's certainly _more_ well-defined than OOP: a functional programming language is one which is based on lambda calculus.
- Rochus 5y agoIsn't every existing programming language eventually based on (or at least traceable to) lambda calculus? OOP is just another way to organize code. Human language is unsuitable for "glass clear", unambiguous definitions, just because of its inherent fuzziness (which is nota bene an essential property for efficient communication).
- ebingdom 5y ago> Isn't every existing programming language eventually based on (or at least traceable to) lambda calculus? Not really. FP has an obvious connection to lambda calculus. Many OOP languages don't even have a straightforward notion of "function", which is what lambda calculus is all about.
- Rochus 5y agoDid you have a look at e.g. https://www.amazon.com/Theory-Objects-Monographs-Computer-Science/dp/0387947752 https://www.amazon.com/Theory-Objects-Monographs-Computer-Sc...?
- smitty1e 5y ago> Enough with the ECS advocacy however. Entity/component/system sounds like model/view/controller. But I like to think of data/logic/presentation. The point being that keeping these dimensions orthogonal is more imoprtant than how they are labeled.
- ehnto 5y agoThey are quite different concepts and certainly in practice. At it's barest, a controller organizes models and renders them into a view. Again simplifying, an entity has components which describe it's functionality, and the entity can get passed through a system. The entity is the concept of the thing, and the components are it's features. The system uses the features to make decisions about how the entity interacts with the system. I've never seen MVC used in anything but single-run applications that end with an discrete output. Whereas ECS is more often used in software with a perpetual state and loop, such as game engines. Exceptions abound.
- dragonwriter 5y ago> I've never seen MVC used in anything but single-run applications that end with an discrete output. MVCs original use was GUIs, which are not “single run applications with a discrete output”, but instead “software with a perpetual state and loop”. Yes, its since been adapted to web use, which usually fits that single-run description, but still...
- ehnto 5y agoThat's interesting, I knew it was a pattern older than it's use in the web but hadn't given it much thought. There's certainly nothing inherent in either design that limits them to either use case.
- slver 5y agoKeep in mind the "web" use of MVC originates with Ruby on Rails. Which actually significantly misunderstood what MVC is...
- ncmncm 5y agoClasses were never definitional for OO, so prototypes, as originated in Self and adopted in JS, are not a violation of it. Function calls and messages are, fundamentally, isomorphic. Messages were never definitional. The notion of "purity", everything is an object, was never definitional. That was a Smalltalk conceit. Alan Kay named the idea, but stole it. So he doesn't get to impose his religion. What is definitional? Inheritance, encapsulation, methods. But when you abandon specious purity, OO becomes one organizational style among many. Where it is the right thing, it is. Where it isn't, something else is. Sometimes mechanisms invented for OO are useful for other organizational purposes, without bringing along OO—which is fine. Implementation inheritance? Sure, why not? That's "bad OO", but OO isn't sacred, so not blasphemy. It has consequences, but they are sometimes—often, even—OK. "Data-oriented"? "Entity-relationship"? "Functional"? "Pipelined"? Other organizational styles, also useful. In places. OO will not die. The others will not die. All organizational methods have their place. Games can have pockets of OO. Simulations can have pockets of OO. Nobody is keeping score. Purity is a farce.
- Hermel 5y agoThe essence of OOP is not inheritance, that’s a nice to have. The essence of OOP is to encapsulate the data and the functions that operate on that data into an object and hide the internal state of the object from the rest of the program.
- ncmncm 5y agoOO less inheritance has a different name: object-based. It isn't better or worse. But the distinction is worth keeping.
- chriswarbo 5y agoIf this is the essence of OOP, would you consider modules/existential-types in StandardML to be OOP? As a followup, what about OCaml (is that "more OOP"?)
- jcelerier 5y ago
- kstenerud 5y agoIt sounds a lot like he's trying to claim victory via semantic quibbling. We've learned a lot and incorporated a lot of ideas, machines, and concepts into the mainstream over the past few decades. But one thing that hasn't stayed the same is what set of things fits into what grab bag encompassed by a word someone came up with decades ago to describe the state of things at the time. Once you start arguing "OOP" vs xyz or "FP" vs xyz, you've missed the point.
- throwaway894345 5y ago> Once you start arguing "OOP" vs xyz or "FP" vs xyz, you've missed the point. I think if we were intellectually honest in our arguments this would be fine—we could manage that OOP is poorly defined. Instead almost every debate about OOP takes this form: someone criticizes things which are exclusive to OOP (e.g., inheritance) or very common in OOP (kingdom of nouns, everything having references to everything else i.e., bananna-gorilla-jungle design or etc) and the OOP proponent argues that these things aren’t true OOP or else that “this is just bad code; anyone can write bad code in any paradigm”. In other words, OOP proponents reliably turn the debate toward semantics rather than engaging with the substantial criticism (if it is “just bad code” why does it seem to be so much more prevalent in OOP than FP?). We could have a more interesting, robust debate, but poorly defined terms + bad faith means we get the same no true Scotsman rhetoric over and over, and it’s hopelessly dull. To your point, critics of OOP could do more to anticipate these semantic arguments. Rather than using the term “OOP” they could just criticize features directly or they could give their definition of OO up front.
- kstenerud 5y ago> or they could give their definition of OO up front. This is exactly what they must NOT do. If one is going to criticize, criticize the actual bad concepts, not the (poorly defined) paradigm. OOP and FP are effectively undefinable, and rightly so since they have outlived their usefulness as vehicles for introducing their respective "bunch of concepts". Nobody's going to agree in the modern era what OOP or FP encompass, and anyone who attempts to define them will rightly be lambasted for it. But we CAN agree on the definition and argue over the merits of concepts such as inheritance, immutability, lazy evaluations, closures, encapsulation, monads, etc. And the fact that languages are taking concepts from both "camps" shows how they were never actually opposed; merely components of different schools of thought that happened to contain some incompatible or opposing concepts.
- bregma 5y agoSummary of article: there is some badly-designed software that claims to be OOP, therefore OOP is useless.
- deleted 5y ago[deleted]
- samsquire 5y agoECS is often implemented in an OOP language. I know of no ECS languages. You have objects that you iterate over and apply changes to the struct or object's fields like x and y coordinates in a game tick for the "next state" Essentially you end up with lots of global functions and very large API space that has no ordering. There's inherent ordering to global function application to produce the correct result. So it produces complex APIs. If you move the global functions to the entity objects themselves, you end up with OOP. So I'm not really sure what the author is arguing for.
- cout 5y agoWhat would an ECS language look like? Would it differ substantially from an OO language? ECS seems to me more like a pattern than a paradigm.
- galangalalgol 5y agoAnd that pattern is easy to implement in C or fortran 77 without being unidiomatic. So I don't vthing you need anything special. Edit: to clarify, a system can just be a function, an entity just an ID and a component should be plain old data anyway, so a struct is perfect.
- ratww 5y ago> a system can just be a function, an entity just an ID and a component should be plain old data anyway, so a struct is perfect. Correct. This is exactly how most ECS frameworks are implemented today (except when it's implemented in languages that doesn't have those features, of course).
- kazoomonger 5y agoI don't think ECS as such would really make a language on its own, but languages that use traits instead of inheritance would be approximately that. Both ECS and traits eschew using the inheritance-style "is-a" thinking. ECS goes for "has-a" thinking, and traits go for "acts-as" thinking. A few popular trait-based languages that would feel comfortable to someone familiar with ECS are Rust or Go.
- flohofwoe 5y agoIMHO what actually killed OOP was the attempted industrialization of software development driven mainly by "Enterprise Java" (and similar failed ideas like UML). The promise was that with OOP it's possible to build complex software projects with cheap "unskilled labor", because OOP would provide the "framework" for managing complexity by plugging together very simple parts. Two decades later we're still trying to clean up the resulting mess, but I think all in all we're on the right trajectory since around 2010.
- kaba0 5y agoFirst of all, OOP is most definitely not killed. Second, OOP is indeed (one of the idioms) what makes it possible to build complex software — even complex, pure C programs sort of do something OOP-like in the end. > Two decades later we're still trying to clean up the resulting mess, but I think all in all we're on the right trajectory since around 2010. And no, we didn’t use to write better code, it is only bias/we simply ignored most of the requirements, eg. ASCII-only, etc. Unfortunately most software products are not incentivized to be over the top stable so a few bugs here and there are “okay”. But that is an orthogonal problem.
- twobitshifter 5y agoRuby is interesting because everything is an object like smalltalk but matz was also directly inspired by emacs lisp. I think it shows that you don’t need to only live in one world despite the evangelists on both sides demanding purity.
- bob1029 5y agoIn my experience, OOP works great until you run into a problem domain with circularly-dependent types that actually make sense as such to the business. Certainly, there are ways to manage this within the realm of OOP, but I strongly argue that these solutions are half-assed at best. Also, nesting of complex types (i.e. making assumptions about the shape of the domain model) also seems to be a large part of what causes pain in larger code bases. > Most programmers I have met in person tend to divide the world thus: > Wacky research stuff. Unproven, Scary, Unmaintainable. For us, the "Wacky research stuff" is how we finally solved many frustrations we had with implementing software against our particular business. A relational/functional hybrid model (implemented using C#8 & SQL) has proven to be far superior to any other approach we have taken over the last 6 years. But, we still do OOP in other places where it still makes sense to do so.
- cout 5y agoEven the most fundamental types in smalltalk derivatives are circularly defined (using Ruby as an example: Object is an instance of Class, and Class inherits from Object). Circularity doesn't make this any less useful as a model, just more difficult to reason about. It's a tradeoff.
- ProfHewitt 5y agoAxiomatization up to a unique isomorphism is the way out of the circularity. Actors have been automatized up to a unique isomorphism. See the following: * https://papers.ssrn.com/abstract=3603021 https://papers.ssrn.com/abstract=3603021 * https://papers.ssrn.com/abstract=3418003 https://papers.ssrn.com/abstract=3418003
- dkarl 5y ago> The question is, how do you add those components together? One solution is to use mixins. This gives us some flexibility back, but we can go even further. See, mixins still tie the data of the component to the code that processes it. But when you think of it, some data, like the position of an object, can be useful for several systems (rendering, collision detection, AI…). Typeclasses allow you to treat your entities as objects with behavior, while at the same time separating concerns in your codebase. The behavior is defined wherever makes sense according to the separation of concerns and then "added" to the bare entity object where it is needed. You don't really even need typeclasses to achieve this behavior. It's just the adapter pattern. You might not get the absolute best efficiency this way, but it's not a fatal blow to combining ECS style and OO style.
- theknocker 5y agoSo there's this thing which one might call an "object" which is fundamental to any discrete thinking we ever do and is, in fact, prerequisite for "concept." There are some bad ideas in what we call "OOP," but if you think have a reason you don't need a thing in programming, then good luck to you.
- adsharma 5y agohttps://en.arguman.org/object-oriented-programming-is-a-trillion-dollar-disaster https://en.arguman.org/object-oriented-programming-is-a-tril...
- gnufx 5y agoConcerning the mention of closures: … it does seem to me that … OOP represents the discovery by the mainstream community that it is a good idea to associate code with data, but, since they still don't know how to do closures, they have bodged it. — Robin Popplestone, <2h6lcoINNkf7@ymir.cs.umass.edu>, comp.lang.functional
- aliasEli 5y agoOne of the very few things that most people can agree upon, is that SmallTalk is object-oriented. SmallTalk definitely has closures. Also Java has them.
- gnufx 5y agoI don't know what he considered the mainstream -- perhaps not Smalltalk -- but the comment pre-dates Java. (I think his POP-2 pre-dates Smalltalk.) If you take the remark seriously, it's probably not just a question of having closures but what you (can reasonably) do with them. A Schemer might experiment with implementations of different object systems, Smalltalk-like, prototype-instance (about a page of code), and CLOS-like. Do people do so in Java (or even Smalltalk) and what does it look like if so?
- scroot 5y agoIn terms of Smalltalk, the answer is "yes". Some examples of what it looks like include the original Self language / environment [1], Newspeak [2], and even Tony Garnock-Jones' implementation of Actors [3]. Some of this has to do with the fact that the virtual machine for many Smalltalk implementations is implemented in Smalltalk itself. So you can start with Smalltalk and end up with something modified enough to be considered different. [1] https://selflanguage.org/ https://selflanguage.org/ [2] https://newspeaklanguage.org/ https://newspeaklanguage.org/ [3] https://tonyg.github.io/squeak-actors/about.html https://tonyg.github.io/squeak-actors/about.html
- ProfHewitt 5y agoA big challenge with OOP is that it was never rigorously defined. Objects originate in Simula-67. OOP derived from objects of Simula by its very name. Simula does not have messages. Instead Simula has virtual procedures attached to classes such that each object is an instance of a class. Furthermore, Simula does not have interfaces. Actors originated in 1973 as the universal abstraction for digital computation including concurrency, which was omitted from Simula and subsequent OOP programming languages. Furthermore, Actors differ from OOP objects in that they are rigorously characterized up to a unique isomorphism. Actors are computationally more powerful than the lambda calculus and Turing Machines.