Live data from Hacker News

Why OO Sucks by Joe Armstrong (2000)

cs.otago.ac.nz

251–260 of 396 posts

Re: Why OO Sucks by Joe Armstrong (2000)

#251
It's always interesting to see " sucks" headlines. Maybe that's also intrinsic to the popularity, on the one hand this got popular for a good reason most likely. But on the other many people might be very careless when using that paradigm and only inform themselves superficially - at best - about the background. That said, I really like how JS had been tamed through OO despite the FP approach being much more interesting.

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...)

Re: Why OO Sucks by Joe Armstrong (2000)

#252
post #95

Earlier 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

Watch your tone!

Re: Why OO Sucks by Joe Armstrong (2000)

#254

Earlier 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…

> 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

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)

#255

Earlier 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…

Back when I wrote a lot of obj-c is when I really 'got' message passing vs. a function call. I miss obj-c, but everyone wants to move on to Swift.

Re: Why OO Sucks by Joe Armstrong (2000)

#256
It just makes sense to me:

  * 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)

#257
post #6

The 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…

I don't know why people keep insisting on using generic words as identifiers when doing so makes it much harder to find something. If I enter "fwrite" into Google, the correct documentation pops right up. I can easily find all the places where file write occurs in my code. I can easily find all the places where network activities are triggered when the associated functions have unique names. Using a if statement and four different *_read function calls is not a shortcoming at all when you take test coverage into consideration.

Re: Why OO Sucks by Joe Armstrong (2000)

#258
post #150

Earlier 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.

My first exposure to the actor model was with Akka on Scala. After working with it for a little while, I thought "this is what OOP should be, perhaps I just hate broken implementations of OOP (i.e., Java, C++), rather than OOP itself." Heck, I like Ada95's implementation of OOP better than Java's.

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)

#259

Earlier 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…

Are you the Alan Kay. Is there any way we can verify this is you? The HN user account seems to have a very low "karma" rating, so one can't help but be more suspicious.

Re: Why OO Sucks by Joe Armstrong (2000)

#260
post #72
post #12

Earlier 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…

OOP has evolved. If you want to get a clearer idea of where it's at, look at Kotlin instead of a twenty-five year old language.
Post reply on HN