3 ms·
Please elaborate on how OO is fine. OO hides state, which makes reasoning about cache, and therefore performance very difficult, which is why most game programe
by ilovecaching 8y ago
Please elaborate on how OO is fine. OO hides state, which makes reasoning about cache, and therefore performance very difficult, which is why most game programers take a data oriented approach. It hides state but gains none of the advantages of Erlang because all of the implementations forgot to make state only mutable through explicit message passing. Inheritance isn’t an abstraction because you inherit both code and state, which requires explicit knowledge of the intervals of the parent. It’s a code pasting tool. As OO tries to model arbitrary patterns in nature it’s also difficult to reason about the graph of objects apposed to the linear flow of data in FP. Pretty much all of the OO languages are walking back OO features at this point and trying to add type classes (contracts) or functional pieces, mapping and filtering a la linear data transformations.
- blattimwind 8y agoThese are actually all fairly common problems so I'm not sure why this is drowned out in gray...
- Cyph0n 8y agoThe over-zealous tone may annoy some people. Also, he/she could have gotten the same point across more effectively without implying that Erlang and FP magically solve all problems.
- spricket 8y agoI actually agree with you here that OO is overused. Java has added quite a bit of FP in recent years though. Lombok makes immutable data classes trivial. Improved interface support for default methods make it possible to largely ignore OO if you don't want it. FP is mostly a community effort at this point, but solid. Java Streams are decent for basic stuff like map/filter but RXJava is extremely powerful if you want the complexity it comes with. Vavr is nice for adding more FP types too
- Scarbutt 8y agoTrue, class inheritance is so hard to get right that is just better to avoid it. Lots of coupling and spaghetti code because of this, but to be fair, you also see this on other languages, like python, php and even JS.
- int_19h 8y ago> It hides state but gains none of the advantages of Erlang because all of the implementations forgot to make state only mutable through explicit message passing. Smalltalk is exactly like that - other objects' state is only mutable through explicit message passing. It's also widely considered the penultimate pure OO language. > Pretty much all of the OO languages are walking back OO features About the only feature I can think of for which this is somewhat true is inheritance, and that's because we realized that aggregation is often a better model, and can be easily supported by the language to be no more verbose. But it doesn't fundamentally change OO - it was never about inheritance first and foremost; I mean, prototype-based OO doesn't even have that conceptually. > and trying to add type classes (contracts) In most OO languages, these typically naturally evolve out of interfaces. > functional pieces, mapping and filtering a la linear data transformations. This is not contradictory to OO in any way. Again, Smalltalk has had "select" (filter) and "collect" (map) from the get go.
- jholman 8y agoMinor question: what does the word "penultimate" mean in your comment?