Live data from Hacker News

Goodbye, Object Oriented Programming

medium.com

101–110 of 355 posts

Re: Goodbye, Object Oriented Programming

#101
post #88

I think that fundamentally OOP and FP are both necessary for any language that wants to run relatively close to the metal. The reason is that a computer is fundamentally all about state and you need something to manage the that state. This is the antithesis of FP. OOP manages state somewhat nicer.

Actors (classes that call with true async messages, potentially over the network) composed of objects (classes that call with simple sync stack) which use pure functions whenever possible. Explicitly handled state + mutations, polymorphism, implicit safe concurrency, fast local calls + opportunities to optimize + safe and easy to reason about.

We are agreeing right?

Re: Goodbye, Object Oriented Programming

#102

Let me try to list the objections: 1. Inheritance creates dependencies on their parent class 2. Multiple inheritance is hard 3. Inheritance makes you vulnerable to changes in self-use 4. Hierarchies are awkward for expressing certain relationships All true. But likewise, functions introduce dependencies on their arguments, and data structures introduces dependencies on their fields. You must consider your dependencie…

> 2. Multiple inheritance is hard

It needn't be. The awkwardness of multiple inheritance in C++ comes from the fact that C++ classes try to be both classes and abstract data types, and end up not fulfilling either role in a satisfactory manner. In OCaml, where abstract data types and classes are completely separate and unrelated mechanisms, multiple inheritance is the most natural thing in the world.

> 4. Hierarchies are awkward for expressing certain relationships

Hierarchies are totally fine. The problem is tying vtables to individual objects. This deprives you of the ability to say “this virtual method operates on two objects of unknown types”, because the only type that can be abstracted is that of the object carrying the vtable. Haskell-style type classes and CLOS-style generic methods don't have this problem.

> 5. Reference semantics may result in unexpected sharing

Unexpected sharing is only a problem with mutable data.

> This has more to do with reference semantics than objects.

How many languages that call themselves “object-oriented” don't equip all objects with a first-class identity?

Re: Goodbye, Object Oriented Programming

#103
post #52

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.

The self-descriptions people use these days are so ludicrous it's hard to tell if it's satire. If I had a Medium account, here's how my description would read: "Software Engineer, Philanthropist, Astronaut, Shark Hunter, Breaker of Chains, Lord Commander of the Snack Bin, Protector of the Repo, and Part-time Cat Dad" Too much or just right?

"Software Astronaut" maybe? I'd go for "Teacher" (just a little bit more gnomic than "Educator"), and put it before "Philanthropist", all segues nicely from "I'm a serious adidactic genius" to "but I've got a fun side"

Re: Goodbye, Object Oriented Programming

#104

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. Just about everything on Medium is crap. It's all designed to push the same social media narcissism button.

Re: Goodbye, Object Oriented Programming

#105
post #86
post #52

Earlier quoted context omitted.

The self-descriptions people use these days are so ludicrous it's hard to tell if it's satire. If I had a Medium account, here's how my description would read: "Software Engineer, Philanthropist, Astronaut, Shark Hunter, Breaker of Chains, Lord Commander of the Snack Bin, Protector of the Repo, and Part-time Cat Dad" Too much or just right?

Add some beer brewing or artisan mustard, also "Educator". Makes you more well-rounded. "Philantropist" is always good.

"artisan mustard" lol

Re: Goodbye, Object Oriented Programming

#106

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 missing "web artisan". So much self-entitlement.

>> It's missing "web artisan"

Snicker. I totally love this and am stealing it from you.

Re: Goodbye, Object Oriented Programming

#107
post #88

Earlier quoted context omitted.

Actors (classes that call with true async messages, potentially over the network) composed of objects (classes that call with simple sync stack) which use pure functions whenever possible. Explicitly handled state + mutations, polymorphism, implicit safe concurrency, fast local calls + opportunities to optimize + safe and easy to reason about.

We are agreeing right?

Absolutely. I just wanted to put in a mention for actors.

Re: Goodbye, Object Oriented Programming

#108

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

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 problem with OOP is not that it forces you to do things a particular way, it's that what's new about it (privileging the first argument of each procedure, inheritance, lots of hidden mutable state) is bad, and what's good about it (encapsulation, polymorphism) is not new.

Re: Goodbye, Object Oriented Programming

#109

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.

Well he just said he wants to do functional programming. He did not mention OOP is dead and functional is the only future...

Re: Goodbye, Object Oriented Programming

#110
post #40

Earlier quoted context omitted.

Only thing missing is "Father..."

Well he did leave an ellipsis at the end of the sentence, implying that the list isn't exhaustive. He could have many more grand titles and occupations. His headshot is also a Jobs-esque, black and white photograph of him wearing a black shirt. This must be satire, right?

[deleted]
Post reply on HN