• nous@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Overall I agree with what the author says, though I have a few further thoughts:

    One might argue that writing types are time consuming, and the bugs are not an issue when programmer can cover those cases with automated tests.

    These two arguments contradict each other and together are an argument for static typing, not against. Which just shows how weak these arguments are.

    but a more powerful type of inference that can actually infer the whole type of a function by analyzing the body of the function.

    This bit I am not convinced by. Inferring the API of a function from its body makes it harder to see breaking changes when you refactor the body. It can be useful for internal private helpers, but IMO public APIs should be explicit about their signature.

    Functional Programming

    I would go one step further here. It should support OOP and procedural paradigms as well. No single programming paradigm is best suited to all problems. Sometimes a mixed approach is best. Any language that heavily leans oneway at the expense of the others limits itself to the problems it can best solve. I do admit the far too many languages lean too much towards OOP at the expense of functional style.

    So it is easy to push for a functional style over OOP in new languages. But I would be weary of purely functional language as well.