5 ms·
> If you use type annotations you basically already do that. The type (assertions) are mixed right into the business code! And from there it's not much of a lea
by camus2 9y ago
> If you use type annotations you basically already do that. The type (assertions) are mixed right into the business code! And from there it's not much of a leap to keep the unit tests close by.
Unit tests are about testing behavior, not types. Using type annotations has nothing to do with testing.
Putting tests right along the source code is a matter of convenience thus an opinion.
In some languages like Go it is even "good practice".
- lmm 9y agoGood types express behaviour.