Hacker News new | ask | show | jobs
by unshavedyak 260 days ago
Your post reminds me of the old runtime vs compile time language debates of old (for me). Some would argue duck typing is all that we need, and that lots of tests can cover the missing types/etc. Eventually i realized that i'm just manually implementing compile time typing by way of robust tests to cover interface requirements.
2 comments

> Eventually i realized that i'm just manually implementing compile time typing by way of robust tests to cover interface requirements

This, so much this!

Note that duck-typing can still be a compile-time thing: it's basically what you'd get in C++ if you use auto and templates for everything.

The trade-off between compile-time and run-time checking depends in large part on the time needed to address the issue. It's not really black and white. People just don't want to wait forever for static verification - I think that's kind of why clang-static-analyzer isn't used as much as clang-tidy.