Live data from Hacker News

Why OO Sucks by Joe Armstrong (2000)

cs.otago.ac.nz

11–20 of 396 posts

Re: Why OO Sucks by Joe Armstrong (2000)

#11
post #3

I think this may be another one of those swearing-in-church type opinions, but I think C++ is excellent as a compromise here. It's got its faults, but C++ allows use of objects when necessary or helpful without the ridiculously pedantic OO of Java. It is quite nice to be able to use it when convenient while not having to do so when stupid.

You getting downvoted for this completely inoffensive (at worst) comment is pretty sad

I swear C++ gets a bad rap because most people have only seen a gross mixture of C++98 and C in their codebases

A fully modern C++11 codebase is a beautiful thing

Re: Why OO Sucks by Joe Armstrong (2000)

#12
post #8

Everything sucks, they just all suck differently. I still think OO provides a pretty easy mental framework for programming. You can get good results. Bit of discipline without going crazy and it works really effectively. Despite its shortcomings.

OO is the worst programming paradigm in the world except for all the others.

Re: Why OO Sucks by Joe Armstrong (2000)

#13
post #3

I think this may be another one of those swearing-in-church type opinions, but I think C++ is excellent as a compromise here. It's got its faults, but C++ allows use of objects when necessary or helpful without the ridiculously pedantic OO of Java. It is quite nice to be able to use it when convenient while not having to do so when stupid.

You getting downvoted for this completely inoffensive (at worst) comment is pretty sad I swear C++ gets a bad rap because most people have only seen a gross mixture of C++98 and C in their codebases A fully modern C++11 codebase is a beautiful thing

Why are you so sure the downvotes are not coming from the opinion of the "ridiculously pedantic OO of Java"?

Re: Why OO Sucks by Joe Armstrong (2000)

#15
I'm really sick of these 'why blah sucks' posts. Clearly OOP works for a lot of people. If it doesn't work for you, don't use it. My personal feeling is that FP works better when the problem domain is more data oriented, requiring transformation of data streams whereas OOP is good when the problem domain is about simulating or modeling where you want to think about interacting agents of some kind. The whole 'X is one true way' argument is narrow sighted. I feel the problem should always precede the solution

Re: Why OO Sucks by Joe Armstrong (2000)

#16
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…

But wouldn't you have four different read functions in your OOP example anyway, just each in it's own object?

Re: Why OO Sucks by Joe Armstrong (2000)

#17
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 think you could use a curried read function, in this case. The read function would be passed as an argument instead of your I/O stream. I fear I've slipped somewhat into OO habits by using Go interfaces.

Exactly right. "Polymorphism" is nothing more than passing a function [or bunch of functions] as argument[s] of another function.

Re: Why OO Sucks by Joe Armstrong (2000)

#18
post #3

I think this may be another one of those swearing-in-church type opinions, but I think C++ is excellent as a compromise here. It's got its faults, but C++ allows use of objects when necessary or helpful without the ridiculously pedantic OO of Java. It is quite nice to be able to use it when convenient while not having to do so when stupid.

You getting downvoted for this completely inoffensive (at worst) comment is pretty sad I swear C++ gets a bad rap because most people have only seen a gross mixture of C++98 and C in their codebases A fully modern C++11 codebase is a beautiful thing

> A fully modern C++11 codebase is a beautiful thing

Can you point to an example of such? It would be nice as someone who’s been away from C++ for a long time.

Re: Why OO Sucks by Joe Armstrong (2000)

#19
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…

It's unfortunate you're being downvoted for your opinion instead of having other ideas presented to you so I'll do my best though I'm no expert.

> Whereas in the functional world, you’ll have to 4 different ‘.read’ function calls with an if statement.

You could do this but that's not idiomatic.

What you would preferably do is have a function that takes a read function as a parameter. This is essentially the same thing as what OO languages implicitly do.

For an example of generic functions you can take a look at map or fold/reduce. You'll see they don't need to use if statements in the way you described.

Re: Why OO Sucks by Joe Armstrong (2000)

#20
post #3

I think this may be another one of those swearing-in-church type opinions, but I think C++ is excellent as a compromise here. It's got its faults, but C++ allows use of objects when necessary or helpful without the ridiculously pedantic OO of Java. It is quite nice to be able to use it when convenient while not having to do so when stupid.

> ridiculously pedantic OO of Java

Are you trying to imply that whoever dies with the biggest exception stack trace does NOT win?

Post reply on HN