And yet, they prevented me from committing dumb mistakes to the main branch so many times.
> types are just simple unit tests written for you
Even better if I don't have to write them. Is this really a counter argument?
> dynamic languages only need unit tests because they don't have type systems
But every language has a type system! How would they differentiate an integer from a string if they don't?
Even assembly has a type system (byte vs word vs double-word).
Am I just nitpicking or is that argument fundamentally flawed and ignorant?
> What's going on here? These can't both be right.
They can both be wrong though, and they seem to be IMHO.
This does not incite me to watch the 20min video. This seems too click-baity.
But you're right, this description is for sure clickbaity.
In my opinion, unit tests need to cover multiple levels, at least two, the units, and also the business logic, and proper types would cover the gaps in between. If anything I would invert the title of this, and say a strong enough type system makes unit tests unnecessary, but I don't think that's anything new and you can see it at work in pure FP languages like Haskell.
But unlike conventional "unit-tests" they also apply inside the code, not just on its externally observable call-boundary.
So perhaps more appropriately then types are "reusable assertions".