Live data from Hacker News

Goodbye, Object Oriented Programming

medium.com

171–180 of 355 posts

Re: Goodbye, Object Oriented Programming

#171
post #125

The king is dead, long live the king! Thinking that a new framework/language/paradigm will solve all your problems is naive. The author should know that if they've truly been programming for decades, as stated in the article.

Who said anything about "solving all problems"? How about just making some things a bit better? I'm get really annoyed when I see the argument "Y does not solve all the problems in X, therefore there is no point in moving away from X."

Re: Goodbye, Object Oriented Programming

#172

God damn it I begin to hate Medium. Just another Bullshit article. When I read those dips ts description: "Software Engineer and Architect, Teacher, Writer, Filmmaker, Photographer, Artist…" Great. And you want to tell me that OO is dead and functional the only future? Fuck off.

agreed

Re: Goodbye, Object Oriented Programming

#173

God damn it I begin to hate Medium. Just another Bullshit article. When I read those dips ts description: "Software Engineer and Architect, Teacher, Writer, Filmmaker, Photographer, Artist…" Great. And you want to tell me that OO is dead and functional the only future? Fuck off.

I get your desire to deflate something you dislike. I know this calling-out of OOP, as in TFA, has become routine (e.g., Steve Yegge's posts were quite celebrated here, and that was years ago). Maybe you're tired of the banana quote, and thought this post brought nothing new.

But your comment is purely ad hominem -- to the point of calling the author a dipshit with absolutely no basis -- and does not engage TFA (breaking the first two comment guidelines at https://news.ycombinator.com/newsguidelines.html).

Re: Goodbye, Object Oriented Programming

#174

Earlier quoted context omitted.

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

Conceptually, components have state, but it's all managed by react, so you only ever write pure functions. Granted, depending on how you update state in event handlers and lifecycle methods, you will need to think about state a lot, but this is an unavoidable fact of UI programming. > every component must be created by extending a base class This is an implementation detail, instead of ES6 classes you can also use Re…

Also, now in react (as of 0.14 with stateless function components) you can define components as pure functions that return a jsx dta structure to the render function. IE (coded by memory quickly syntax may be wonky): const test_component = () => { return Blah!; }

Re: Goodbye, Object Oriented Programming

#175
post #151

God damn it I begin to hate Medium. Just another Bullshit article. When I read those dips ts description: "Software Engineer and Architect, Teacher, Writer, Filmmaker, Photographer, Artist…" Great. And you want to tell me that OO is dead and functional the only future? Fuck off.

It's not just Medium. I get followers on Twitter who have that kind of bio, except that the bio words are separated by pipe signs. My bogofilter tells me that they are all likely part of a scam of the same group. Further confirmed by the content of their tweets, which follow a pattern.

If only t'was a scam. Praise the sun.

Re: Goodbye, Object Oriented Programming

#176
post #11

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?

My impression of react is that it's very object oriented. Defining reusable, stateful components is classic OO design. Now, I don't have much experience with React so maybe someone can explain why it should be considered "functional".

Not sure why people have that impression. It doesn't fundamentally do any OO things. You don't inherit from the react components. Maybe you could make an argument for encapsulation but even that is shaky in JavaScript. Most it only uses prototypes as object for namespacing and to organize the api better since JS lacks good namespacing syntax.

Re: Goodbye, Object Oriented Programming

#177

Earlier quoted context omitted.

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

>even now functional languages are slower OCaml is famously faster than C++.

OCaml is quite fast, and I guess it could produce faster code than C++ on some occasions, but it's definitely SLOWER than C++ for most benchmarks, e.g.:

benchmarksgame.alioth.debian.org/u64q/compare.php?lang=ocaml&lang2=gpp

Re: Goodbye, Object Oriented Programming

#178

Earlier quoted context omitted.

Except that there is a real advantage to using pure functional programming; being able to easily prove theorems about your code and understand different components in isolation. There is a reason why the majority of proof assistants are implemented as functional languages. Most functional languages even give you ways of modelling imperative code (e.g. monads) in a way which hardly sacrifices expressiveness. The real…

> Except that there is a real advantage to using pure functional programming; being able to easily prove theorems about your code and understand different components in isolation. And how often does that occur in practice for most of the programs people write? Even the most hardcore Haskell programmer isn't going around proving theorems about their modules beyond what the type system can provide for free (and that is…

Any sort of thinking about what the code does or does not do is essentially proving theorems about it, is it not? It seems to me one does that all the time when debugging.

Re: Goodbye, Object Oriented Programming

#179

Programming paradigms are a lot like political parties -- they tend to lump a lot of disparate things together with a weakly uniting theme. You don't need inheritance for encapsulation to be useful, for instance. The problem is, sometimes you agree with only a small part of the platform. None of these things individually are terrible ideas if tastefully applied, but it all gets clumped together into one big blob of "…

> I tend to prefer languages and tools that adopt good ideas without promoting a single specific way of thinking.

Do you mean promoting, or enforcing?

There are many aspects of, say, the Zen of Python that I am very grateful for.

Re: Goodbye, Object Oriented Programming

#180
post #56

Most of the problems he brings up are already addressed in major OOP languages. 1) Inheritance can be confusing and messy. Yes, hence the advice: Prefer composition over inheritance. Instead of having B inherit from A, declare an interface I, and have both A and B implement I. If B wants to reuse A's functionality, it's free to do so through composition, and not through inheritance. There are some edge cases where in…

Soo..We said never look for something better than Java? Or OOP? What if FP gives us all the important things that OOP does and more? Why wouldn't we use it?

Personally I want to learn from and use a language that supports as many of the paradigms as possible, like Scala or Swift. Let me choose based on what I need. That being said I'd much rather work in pure FP then OOP because of the fact that most of the advantages of OOP can be achieved via FP and the inverse is not true.

Post reply on HN