• ☆ Yσɠƚԋσʂ ☆
    link
    52 years ago

    In my experience it’s not really about OO being easier to learn, in fact I’d argue it’s much harder to use correctly. It’s really just the fact that people are more likely to learn it first and then once they learn it they stick with it.

    What makes learning FP difficult if you’ve already internalized imperative style is that patterns aren’t easily transferable from one to the other. And people confuse having to learn new patterns for writing code from ground up with FP being more difficult.

    My anecdotal experience with this is teaching Clojure to coop students my team hired in the past. We found that students from first and second years could pick up Clojure easily while students third and fourth years often found it more challenging. Main factor was that students earlier in their studies didn’t have a lot of preconceptions about how code should be written where students from later years had to unlearn things.

    I find ego plays a role here as well. People who see themselves as being experienced don’t like feeling like beginners, and that’s what it feels like when you’re learning something different from what you’re used to.

    I’m less convinced regarding static typing though. I find the key feature that makes code maintainable is immutability because it allows doing local reasoning about the code. Any large program can, and in my opinion, should be broken down into small independent components. I don’t find dynamic typing to be much of an issue with this approach and it’s always possible to add things like specs and schemas at component boundaries for ensuring correctness.

    The main downside that I’ve found with static typing is that it limits you to a set of statements that can be expressed using a particular type system. And you either have a restrictive language with a simple type system or a flexible one with a complex type system that introduces its own mental overhead.