Reading this thread is interesting, because I can see myself not too many years ago in castaway's position.

castaway: What that you say is true. Automatic elimination of a couple of clsses of bugs will tend to encourage relative carelessness, just as the backspace key encourages poor typing. The benefits of strict.pm partly show up in reduced errors, and partly show up in needing to spend reduced effort to accomplish the same task. In my experience, both are worthwhile. And with experience, it isn't too hard to switch modes between relaxed and careful when you switch languages. (The first few times though...)

Of course what other people say about strict.pm is also true. Of course it didn't convince you. But I can understand that. You see, I resisted using strict.pm for a long time. Sure, I knew that lots of people used it. Sure, I knew all of the arguments for why it was supposed to be a good thing. But, like most people, I had some arrogance, I thought that I worked better than most, I was careful, I didn't need that crutch.

And exactly because this was a point of pride for me, it was hard for me to realize that I was making excuses for myself. After once too often crashing a production process because I wasn't using strict.pm, I got unhappy when a co-worker chided me because Perl's compiler was so loose that it made things like that hard to catch. Because I knew darned well that Perl did offer a solution, but I didn't want to admit that I just hadn't wanted to use it.

So I turned on strict.pm and caught another bug or two. Not long afterwards, I found that the best way to start fixing bugs in some of the other poorly-designed Perl that I had (my pride makes me point out that most of that was written by other people) was to start by turning on strict.pm, catching some bugs (possibly the one I had to fix) and at the least allowing me to proceed with confidence that a particularly annoying kind of bug to debug was now gone. Eventually, strict.pm became a habit. When I switch to languages with no equivalent, I curse a bit and then adapt back. But when I go back to having it, I relax a little, go faster, and enjoy myself more.

YMMV. But that is my experience.


In reply to Re: to strict or not to strict by tilly
in thread to strict or not to strict by castaway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.