• tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 days ago

    By the popularity of type inference in variable declarations, a feature that’s included in most languages now: var in C# and Java, := in Go, auto in C++, and so on.

    I don’t really like type inference, because I think that it makes it more-obnoxious to read code. That being said, I will concede that if you want a lot of static type information — and compilers can do things with more information — it does make for more concise code.

    EDIT: Hmm. I was trying to think what would make it better. Maybe I’d be more okay with it if all compilers for languages that did this had a trivial way to just run the type inference step and output code with inferred types present.