Functional Programming vs. Object Oriented Programming - eviltoast
  • Pipoca@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    10 months ago

    Just like walking doesn’t really compete, like at all, with flying in an aircraft, Functional and Object Oriented Programming are at their best when you use whichever approach makes sense for a given situation and in any reasonably complex software that means your code should be full of both.

    I’m not really sure sure that’s true.

    In FP languages like Haskell, you get tools like algebraic data types, typeclasses, and pattern matching.

    FP is really opposed to imperative programming, while objects are opposed to algebraic data types.

    You can write OO code that’s 100% fully functional, and you can write code in Haskell or rust where you barely notice you never once used an object.