in reply to to strict or not to strict

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.