3 ms·
The thing is that errors at compile time get reported almost instantly, but errors at runtime might be reported hours after you started your program if you are
by whyever 9y ago
The thing is that errors at compile time get reported almost instantly, but errors at runtime might be reported hours after you started your program if you are unlucky.
- hellofunk 9y agoThat's entirely correct, and one of the tradeoffs. However, in a statically-typed language, you must satisfy the type checker for everything, which adds development time. In reality, there might be a small percentage of functions in your code base for which errors (either compile-time or run-time) would likely crop up, yet you must pay that cost for 100% of them. So that's really where the debate comes from. Dynamically typed languages can get around this problem by generative testing (in Clojure's case) which allow very fine-tuned aspects of your system's requirements to be automatically tested before run-time without writing tests, which offers some of the same confidence as a compiler.