← Back to context

Comment by DojoAsh

2 years ago

Typescript solved the "I spent hours debugging, only to find I misspelled a property" problem. FastAPI did the same for Python. I have noticed that untyped languages (or "dynamic" languages, if that makes it sound more advanced) have typing added to them by people who love the language, but hate 10x debugging.

On the other hand, I can't think of a single example of a strongly typed language that has been "fixed" by someone* to get around typing. Like, "I love building enterprise systems in C++, but I just really miss all those runtime errors that could/should have been caught by the complier."

So maybe the trajectory of languages gives a clue as to which is better.

*I know that would be incredibly difficult, but we programmers are a resourceful bunch.

I'm not sure about "spending hours". In my experience it's more like "detect an error during compilation instead of an exception during execution". Once you see the exception, it's usually quite clear what exact property is misspelled. So strong typing saves a few second of execution and reduces the need for some types of unit tests.

  • It is always the thing you forget to unit test that causes the issue. Or the one code path that rarely runs, and causes a mysterious error once a month.

> I can't think of a single example of a strongly typed language that has been "fixed" by someone* to get around typing

Dependency injection is exactly that.