in reply to Re: Requiring use strict
in thread Requiring use strict
That old code would be pretty easy to fix, if it only needs an 'use lenient;' option...
I never used strict when I started with perl (it made my code fail with a zillion error messages, quite depressing), until someone on this forum pointed out the benefits. I had to bite the bullet, I moved all my little scripts and cgi's over, and it has thought me to write much better perl code.
I don't exactly remember how long it took to switch, but I vividly remember how shocked I was about the number of bugs and typo's found. Unless you (OP) really, really know what you are doing and can give yourself a very good explanation of why using strict would only harm your program, you are probably better off to faithfully start writing your perl with strict, warnings and tainted.
Without strict, your code only looks as if it works. With strict, you get a very good indication that your code really does work (barring any logical errors or wrong conceptual ideas in your code ofcourse). As Jeffa said, use the seatbelt. Maybe it sets you back in a small number of cases (in some freak accidents people die because they were wearing a seatbelt, I've read), but there's no way you can balance it with the number of times it saves you. No matter how good you are; 4 o'clock at night and lack of caffeine is lethal to anybody's concentration and thus code.
So I like the idea of a default 'use strict;', so people who start with perl don't get the wrong idea about it being a frivolous extra like I did at first. 'use sloppy_programming;' should be an option, not the default.
Feel free to disagree, ofcourse.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Requiring use strict
by Wassercrats (Initiate) on Jul 16, 2003 at 04:56 UTC |