in reply to warnings and strict -- The 2 Best Ways You Can Improve Your Programming

Once you're in the habit of using them, ALWAYS, they will do more at a fundamental level to improve the discipline of your programming than anything else I know of!

I have to disagree here. Completely.

I do generally think using warnings and strict is a good idea, especially for people who are relatively new to Perl. I don't, however, think that doing so will improve your programming at a fundamental level at all. In fact, it could be argued that strict and warnings will make you lazier because, well, you don't have to catch those errors if perl is going to catch them for you. More to the point, though, all they can do is help you catch some common errors... like typos, for instance. That's not going to result in programming improvement.

They don't...

The only things they do help with are generally the problems that are easiest to fix anyway.

I agree that they are useful tools but that's it.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re: warnings and strict -- The 2 Best Ways You Can Improve Your Programming

Replies are listed 'Best First'.
Re^2: warnings and strict -- The 2 Best Ways You Can Improve Your Programming
by Jenda (Abbot) on Oct 04, 2005 at 21:56 UTC

    Well, I think use strict; does usually help to improve the structure of the code. If only because you have to think whether you want something to be global or local (lexical). Sure, you can declare all your variables on top of your script with "my" and keep all the bad habits, but it's somewhat less likely to happen then if you don't start using strict at all.

    So it's not going to make your code magically better, but it's going to nag you to make it better yourself.

    Jenda
    XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented.

Re^2: warnings and strict -- The 2 Best Ways You Can Improve Your Programming
by liverpole (Monsignor) on Oct 04, 2005 at 21:09 UTC
    The only things they do help with are generally the problems that are easiest to fix anyway.
    Agreed.  But those problems that are "easiest to fix" become so only after you've reached a certain state of enlightment with Perl.  My point is that you start out miles ahead by using these tools, and they give you invaluable habits which stick with you.  Furthermore, all of the very good bullet items you list are, in my opinion, things that you develop along the path to programming (be it Perl or any language).  I think we can both agree that nobody has a panacea for obtaining them in a short time.

    It's also true that the tools warnings and strict are most necessary for the beginning Perl programmer.  But, having said that, I'm not going to give them up anytime soon.  (:

      Miles ahead? I think you have a long way to go if you think that just adding "use strict" and "use warnings" gives you such a headstart.

      I always use warnings and strict (and know when to turn it off), but I've always considered them to be in the same class as the lights on my dashboard to remind me that the handbrakes are on, or that my oil level is low. Useful, but they don't make me a better driver. And they don't prevent accidents either.

      Perl --((8:>*