Hacker News new | ask | show | jobs
by IshKebab 1777 days ago
Even "old" statically typed languages like Java and C++ are streets better than dynamically typed languages like Python (without type hints).

I don't think people have that view because they haven't experienced modern static typing systems. I think they have that view because they aren't willing to admit that they make the kinds of mistakes that static types help with, and they aren't willing to admit that they benefit from the kinds of assistance that static types provide (autocomplete, go to definition, etc.).

It's annoying.

1 comments

I get autocomplete and goto definition with dynamic languages just fine. And I make mistakes that static typing could have helped, but then again they are not frequent enough to justify the bureaucracy (and they don't break production).

Of course, there is no general rule. This is true for the type of projects that I've been recently working on, which are small-scale distributed web systems.

If a new project demands a rigorous type system, I would probably go to something like PureScript[0] before going to C# clones like TypeScript. It seems that the compiler would help me a lot more in a language like that.

[0]https://www.purescript.org/

> I get autocomplete and goto definition with dynamic languages just fine.

No you don't. See how autocomplete does with this function:

    def foo(s):
        s.
Now try it with type annotations:

    def foo(s: str):
        s.