Live data from Hacker News

Goodbye, Object Oriented Programming

medium.com

91–100 of 355 posts

Re: Goodbye, Object Oriented Programming

#91
The venerable master Qc Na was walking with his student, Anton. Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing - is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil - objects are merely a poor man's closures."

Chastised, Anton took his leave from his master and returned to his cell, intent on studying closures. He carefully read the entire "Lambda: The Ultimate..." series of papers and its cousins, and implemented a small Scheme interpreter with a closure-based object system. He learned much, and looked forward to informing his master of his progress. On his next walk with Qc Na, Anton attempted to impress his master by saying "Master, I have diligently studied the matter, and now understand that objects are truly a poor man's closures." Qc Na responded by hitting Anton with his stick, saying "When will you learn? Closures are a poor man's object." At that moment, Anton became enlightened.

http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m...

Re: Goodbye, Object Oriented Programming

#93

Earlier quoted context omitted.

> For instance I have yet to see an easy and simple to use (and as such maintainable) functional widget and gui library. Like react?

Is this same react where your components keep internal state (called state) and every component must be created by extending a base class?

React supports stateless components, it's literally just a plain JavaScript function.

From the React docs:

> In an ideal world, most of your components would be stateless functions... This is the recommended pattern, when possible.

Re: Goodbye, Object Oriented Programming

#94
post #5

I think the functional vs OO debate is being done with a very narrow point of view. Functional came before OO and there are reasons why it became much more popular- it had much better, easier and simpler solution to the most common problems of the 90's and early 2000's, namely handling GUI and keeping single process app state (usually for a desktop app). It fares much worse in today's world of SaaS and massive parall…

I think the reason is much more fundamental - even now functional languages are slower - even with all the fancy modern compilers, optimizers, GCs that were not even in the same league 20 years ago or more.

OO maps nicely to shared memory model and it's fairly low overhead compared to things like persistent collections data structures. This helps when you are forced to deal with lower level stuff.

Nowdays we are IO bound, we moved from single shared memory machine -> distributed services communicatig with messages and the problems are more about data transformation rather than HW management. OO is cumbersome in this context.

Functional GUI is easy to do, look at clojure react wrappers.

Re: Goodbye, Object Oriented Programming

#95
post #78

Earlier quoted context omitted.

So you list one shortcoming, and don't even cover the position that lambda calculus is better suited as a foundation for a programming language despite not being better at time complexity than a Turing machine would be? http://cstheory.stackexchange.com/questions/21705/what-is-th... My point is basically made here: This algebraic view of computation relates naturally to programming languages used in practise, and muc…

This is the usual response. I didn't say the algebraic approach does not have advantages but the complexity analysis issue is always swept under the rug by proponents of the algebraic approach. Operational and axiomatic semantics also have their place and if the theoreticians haven't yet settled on "the one true way" why is it that regular programmers think they have? I agree that the search for novel composition mec…

Fair enough. I'll agree that their is no "one true way" and contest whether it's likely there is one, however I do think I understand the frustration some theoreticians have with the mainstream of programming when their contributions to programming language theory through denotational semantics, type theory, monads, etc have been largely ignored for the close to thirty years in favor of recycling the same tired dialects of Algol over and over again.

Re: Goodbye, Object Oriented Programming

#96

Thanks for writing up this. I work with OOP programmers a lot and I am tired of explaining problems with OOP over and over. This article just saves me that effort.

You must be fun to work with.

Looks like he works on ETL, i.e. data transformations. So in his niche functional languages are a better match.

Re: Goodbye, Object Oriented Programming

#98
post #83
post #76

Earlier quoted context omitted.

Yes, but the foundation under OOP is considerably less solid. I agree that you can write a bad program in any language, but the fact remains that it is impossible to write certain bugs in statically typed pure functional languages and that functions as a base abstraction are more apt for describing computation than objects are.

Totally agree. But don't forget that the real-world is pretty messy and a lot of people are not willing to think deeply about a problem. They want quick solutions. Out of the people I work with I would trust only a small percentage took the time to understand OOP. Only a few guys will take the time to understand FP. The other people pretty much just copy/paste boiler plate code.

Wow, that's depressing. I haven't had a lot of experience working with other programmers but if this is what the software industry looks like I can understand why you'd have these opinions.

Re: Goodbye, Object Oriented Programming

#99

He qoutes Joe Armstrong's criticism of OO but later Seif Haridi corrected him leading Armstrong to say: "Erlang might be the only object oriented language because the 3 tenets of object oriented programming are that it's based on message passing, that you have isolation between objects and have polymorphism." http://www.infoq.com/interviews/johnson-armstrong-oop

I'm not sure that's a fair summary. Armstrong states that his opinions have changed over time, but mostly because his thesis supervisor pointed out Erlang is perhaps the only truly OO language out there.

After he quotes what Alan Kay says...

The notion of object oriented programming is completely misunderstood. It's not about objects and classes, it's all about messages.

Armstrong then says:

Erlang has got all these things. It's got isolation, it's got polymorphism and it's got pure messaging. From that point of view, we might say it's the only object oriented language and perhaps I was a bit premature in saying that object oriented languages are about. You can try it and see it for yourself.

If you'd like to read some further other anti-OO ("as practiced") quotes, see my fortune clone @ https://github.com/globalcitizen/taoup

Re: Goodbye, Object Oriented Programming

#100
post #72
post #65

Earlier quoted context omitted.

Well said. I feel the same way about this as I do platforms. There is amazing projects on every platform. There is horrendous projects on every platform. Taking sides just a narrows your point of view and lessens the amount you can learn.

We have to take sides. If I commit to iPhone, but there's a lot of stuff in android but I can't take advantage of. And vice versa

Would that lead you to write an article that said 'goodbye android forever' and tell people to avoid it because you prefer iOS?

That's the kind of 'taking sides' I was intending to articulate.

Post reply on HN