Is creative, useful, unconventional, functionality obscure and obfuscated and therefore frowned upon? No, not using strict is just undisciplined. I feel pretty safe in saying that most good, creative, unconventional code is written by people who use strict strictly. When I was a VB programmer, it was easy to divide a line between "stuff that was crap" and "stuff that we don't know about yet but might be crap or might be great stuff" by whether it used Option Declare. So I just utterly disbelieve you. Go write great stuff. I love great stuff. But use strict and disable it only for those small parts where you know it's the best thing to do at that moment.
| [reply] [d/l] |
"it was easy to divide a line between "stuff that was crap" and "stuff that we don't know about yet but might be crap or might be great stuff" by whether it used Option Declare."
"Implicit variable declaration can make writing scripts faster and easier; at the same time, however, it can lead to subtle errors that are difficult to diagnose and fix." Does this definition contradict your statement? (Surprising since it is on M$ TechNet).
| [reply] |
It's worth noting that one of the nicest, in a feel-good kind of way, improvement to my dev tool was when it could be configured to automatically insert Option Declare into everything it created. This prevented me from accidentally omitting it. Its when I'd forgotten to ensure that Option Declare was turned on that I'd just run across some bug allowed by the absence of the restriction. It's at those moments that I knew I had some pain ahead of me as I added Option Declare back in and went back to find the bugs that it had allowed to go undetected. So no. There's absolutely no good reason whatsoever to ever neglect to use Option Declare. There is occasionally a reason to revoke strict but you should never write a script without loading it. Heck, these days I've taught emacs to automatically syntax check my perl on save because that's also really valuable. The more checks that I get automatically, the better code I can write and the less time I have to spend fiddling with stupid plumbing that I've installed wrong.
| [reply] [d/l] [select] |
Actually, in my experience, that definition contradicts itself. It's those subtle errors that are difficult to diagnose and fix that makes writing scripts slower and more tedious. Unless, I suppose, we use "M$"'s definition where writing does not include testing and fixing, nor does it imply writing correctly...
| [reply] |