4 ms·
No, YOU have missed the point. I'm not talking about syntax checking. I'm talking about getting a fast compile-time check for my most common mistakes. The de
by btilly 15y ago
No, YOU have missed the point. I'm not talking about syntax checking. I'm talking about getting a fast compile-time check for my most common mistakes.
The default behavior that you demonstrated from Python is a run-time exception. Until you've gone through every code path, you have no idea whether you're going to trigger that exception. (Even 100% test suite coverage is not enough to guarantee that you won't blow up.) In even a moderate sized program, this can take a good while.
By contrast Perl's behavior with strict is to blow up at compile time, before I begin running the program. This significantly shortens the edit/debug cycle for my most common mistakes.
If you want the equivalent in Python, you have to use external tools like PyChecker.
As for the defaults, there is nothing as hard to change as a misfeature. Everyone agrees that the default would be better if it was reversed, but there is no way to do so without losing backwards compatibility. And given how much critical infrastructure runs on Perl, backwards compatibility matters a lot.