When I use OO, my main motivation is also that it's easier to share code and debugging becomes much more predictable. (Aahh, it's in this encapsulated part of the code...)
Why OO Sucks by Joe Armstrong (2000)
251–260 of 396 posts
Re: Why OO Sucks by Joe Armstrong (2000)
#252Earlier quoted context omitted.
I don’t think I’ve ever seen a useful “Getter” abstraction...
It's frustrating to read this thread and your comment kind of crystallized this for me so I'll respond to you. Using an array without having to (manually) calculate the size of the objects contained within is like the major triumph of OO. This is a getter that you almost certainly use constantly. Please try to consider your statements and potential counter factuals before spraying nonsense into the void
Re: Why OO Sucks by Joe Armstrong (2000)
#253Re: Why OO Sucks by Joe Armstrong (2000)
#254Earlier quoted context omitted.
Isn't a method call a message, and the return value a message back? Or is it that "true OO" must be asynchronous?
In Kay's OO the only way to interact with an object was through method passing. It was important the the internal state of an object was kept private at all times. Getters/setters are technically message-passing methods, but they undermine the design goal because they more or less directly expose internal state to the public world. But we see getters/setters used constantly . People don't use OO in the way Kay intend…
If they do, that's your fault for letting them. I guess you mean when people chain stuff thus
company.programmers.WebDevs.employ('fred')
where .programmers and .WebDevs is an exposed internal of the company and programmers department respectively? (I've seen lots of this, and in much longer chains too. We all have). In which case please see the Principle of Demeter " rel="nofollow">https://en.wikipedia.org/wiki/Law_of_Demeter> which says don't do this. Wiki article is good.
I doubt any language can prevent this kind of 'exposing guts' malpractice, it's down to the humans.
I remember reading that Alan Kay said when he saw the Linda model (" rel="nofollow">https://en.wikipedia.org/wiki/Linda_(coordination_language)>) he said it was closer to what he wanted smalltalk to be.
Re: Why OO Sucks by Joe Armstrong (2000)
#255Earlier quoted context omitted.
Objective-C is much closer to true object orientation than C++, but IMO Apple neutered it by having the program crash if there was no message handler.
It crashes only if you let it. a) The crash is from the default unhandled exception handler, which will send a signal to abort. So if you just want to crash, you can either handle that particular exception or install a different unhandled exception handler b) An object gets sent the -forwardInvocation: message when objc_msgSend() encounters a message the object does not understand. The exception above gets raised by…
Re: Why OO Sucks by Joe Armstrong (2000)
#256 * Domain = logic + data
* Application = logic + data
* Object = logic + data
Nothing wrong with using functions and data objects. But they're often still interdependent. A class just makes it official.Re: Why OO Sucks by Joe Armstrong (2000)
#257The thing is ‘filename’ is a bad example for a an object. Of course, it should be a string. However ‘File’ object is a better example that favors OOP. When you call ‘.read’ on a file object, you expect its content. It doesn’t matter if it’s a windows file, unix file, an IO string, or a web resource. When you call ‘.read’, it just work. Whereas in the functional world, you’ll have to 4 different ‘.read’ function calls…
Re: Why OO Sucks by Joe Armstrong (2000)
#258Earlier quoted context omitted.
> Isn't a method call a message, and the return value a message back? It is! In my view, the point that Alan Kay and Joe Armstrong are trying to make is that languages like C++/Java/C# etc have very limited message passing abilities. Alan Kay uses the term "late binding". In Kay's opinion, "extreme late binding" is one of the most important aspects of his OOP [1], even more important than polymorphism. Extreme late b…
I'm surprised the actor model hasn't been mentioned. Isn't this the modern name for what theyre talking about? Completely independent objects passing messages and entirely parallelizable.
I keep meaning to give Erlang a try, but just haven't had a reason yet. I do a lot of Clojure, these days :)
Re: Why OO Sucks by Joe Armstrong (2000)
#259Earlier quoted context omitted.
I don't believe he claims to, no. He coined the term “object,” but what he meant by a computational object was different than what it came to mean: a data structure with associated operations upon it. Kay meant a parallel thread of execution which was generally sitting in a waiting state—one could make a very strong analogy between Smalltalk's vision of “objects” and what we call today “microservices,” albeit all liv…
I didn't coin the term "object" -- and I shouldn't have used it in 1966 when I did coin the term "object-oriented programming" flippantly in response to the question "what are you working on?". This is partly because the term at the time meant a patch of storage with multiple data fields -- like a punched card image in storage or a Sketchpad data-structure. But my idea was about "things" that were like time-sharing p…
Re: Why OO Sucks by Joe Armstrong (2000)
#260Earlier quoted context omitted.
OO is the worst programming paradigm in the world except for all the others.
Admittedly I'm somewhat of a FP fanboy, but I seriously cannot disagree with you more on this. Functional Programming (and Logic Programming) are better than other paradigms because, unlike Java (or C++, or C#...) there is an emphasis on correctness , and the people working on FP compilers (like Haskell and Idris) are utilizing mathematics to do this. No idea on your opinion on mathematics, but to me Math/Logic reign…