Hello, OOP

Someone shared Charles Scalfani’s article about why they were abandoning Object Oriented Programming and moving to Functional Programming. The points Charles makes are:

  • Inheritance and hierarchies tend to be fragile and difficult to work with;
  • Making variables private in an object doesn’t help that much; and
  • Polymorphism isn’t exclusive to OOP;

These experiences probably resonate with many people who’ve worked with OOP codebases. In any language. So I’m not going to say that Charles is wrong, but I’d like to offer a different perspective of the ideas in OOP here. And maybe that’ll help someone learn something new in the process, who knows?

Why PLs Should Have Effect Handlers

Most programming languages should have a concept similar to effect handlers, even if the language doesn’t include an effect system as well. One reason for this is simply that they’re a cool feature, but the important part is that effect handlers solve a very real tension between programmer intent and execution context, which shows in testing, cross-platform development, distributed computing, and several other common cases.

This piece will briefly discuss what they are, what problems they solve, and how they solve it. For a more detailed treatise of the subject, see Pretnar’s effect handlers tutorial.