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.
Goodbye, Object Oriented Programming
101–110 of 355 posts
Re: Goodbye, Object Oriented Programming
#102Let 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…
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
#103God 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?
Re: Goodbye, Object Oriented Programming
#104God 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.
Re: Goodbye, Object Oriented Programming
#105Earlier 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.
Re: Goodbye, Object Oriented Programming
#106God 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.
Snicker. I totally love this and am stealing it from you.
Re: Goodbye, Object Oriented Programming
#107Earlier 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?
Re: Goodbye, Object Oriented Programming
#108Programming 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 "…
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
#109God 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.
Re: Goodbye, Object Oriented Programming
#110Earlier 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?