3 ms·
> And yet, in many cases they are a productivity drain. Time is often better spend by writing testcases instead of chasing down type issues(more so if a languag
by sime2009 8y ago
> And yet, in many cases they are a productivity drain. Time is often better spend by writing testcases instead of chasing down type issues(more so if a language has a 'generics' or C++ templates concept), so that approach got favored in many fields.
From my experience I've seen that type hinting and checking provides a better ROI than automated testing. It is not either/or, you will most likely need some automated testing, even if it is just unit tests. But at the very least use types. It provides broader benefits than just catching stupid bugs and typos. At makes your code base much easier to understand and code paths much easier to follow.
- megaman22 8y agoWith static typing, you usually have this big suite of unit tests that check a whole bunch of basic correctness out of the box, called the compiler... /s If you actually use the type system, and build less anemic types, you can eliminate huge swathes of potential errors.