in reply to Why use warnings? -w
ARE MY PERL SCRIPTS GOING TO RUN SLIGHTLY FASTER IF I DON'T USE STRICT AND WARNINGS?Yes, in some cases at least, they will probably run slightly faster. Very slightly faster. In fact, so slightly faster that you probably won't be able to notice. And that will not be significant in probably more than 99.9% of the cases. If you have a program that runs in, say, 20 minutes, why should you care about saving a few seconds? In brief, this is really irrelevant.
But that's most probably the wrong question to ask. IMHO, the right question is: will my program be developed and debugged faster if I do use strict and warnings? And, there, the answer is a big YES. Your program is very likely to be ready and working correctly earlier if you do use strictures. Quite often much earlier. Strictures can (and will) save you literally hours of useless debugging time, for example when you made a stupid typo on a variable name (and we all do that type of silly mistake), especially if your program has more than a few dozen lines.
From an economic standpoint, developer's time is usually worth much more money than CPU time. Especially, an hour of developer's time is worth million times more than milliseconds or microseconds of CPU time. Save your own time, don't worry about silly micro-optimizations or your code.
Update: Fixed a typo (s/if/is/) in the last paragraph. Thanks to 1nickt for pointing it out. And also a duplicate word in the first paragraph. Thanks to AnomalousMonk for noticing.
|
|---|