Comment by anyfoo

5 years ago

Pragmatic for me is knowing what’s wrong at compile time, and not being told much much later at runtime that I nested this array in a dictionary in an array wrong, or that my string is an integer.

I got older, stopped using python for exactly the reasons above (I just really felt that it was wasting my time for trivial reasons), and found mypy which made it bearable again.

Yeah, I'd be on board with that if 99% of the people talking about typed languages at the moment weren't using Typescript for use cases where you literally get instant feedback from hot reloading as you code.

Every time I see an example of a bug that TS would solve, it's something that I routinely find in 2 seconds by looking 10 degrees to the left at my second monitor and noticing the screen is white and there's some red text in the dev tools. "Compile time" doesn't mean anything if it consistently happens 0.5s before "run time".

  • As your application gets larger it's not that easy. Even if your code hot reloads all the time, getting to the piece of code that breaks might take 10 clicks or you are working on some feature that has quite a few combinations for use and/or settings that influence it. Maybe some feature flags thrown in. With this setting off and that feature flag on, suddenly your integer is a string. Boom runtime error but only because your QA thought of it when testing it 3 days after you already moved on to another ticket.

Groovy is a dynamic language that runs in the JVM, it lets you put @CompileStatic at the top of every class.

I believe typescript also has options for compiling statically.