Fellow monks,
Forgive me, for I have sinned...
I've started programming when I was 7 years old.. My dad bought a Commodore 64 back in the day, and I fell in love with BASIC programming. I evolved my programming over the years into many languages, Turbo Basic, Turbo Pascal, Turbo C, Borland C++, Delphi, Clarion, VB, until I eventually decided to settle on Perl.
All the professionals have always chastised me for not using strict in any of my code, and I've always been able to tell them that it's not necessary... "My code is working, I've tested it, it's running fine... Go away!" and for the most part, my scripts did work fine.
Then something happened... I decided to write my first Perl modules.. After reading a few bits of documentation, I managed to get my first modules uploaded onto CPAN. Granted it took a few versions to work out exactly what the Makefile.PL script was supposed to look like, but I eventually got there.
The writing of the modules had to have strict in them. Why ? Because the folks that would be using the modules would be stricting, hence I couldn't have a module that would break other applications.
Then something happened. Strict forced me to be a better programmer. Some of my code started breaking, because I had the dirty habbit of declaring a global variable in the main program, and simply reusing that same variable in another do'ed file. Now my code started breaking, but with good reason, and I started to see the light.
In a previous occurence, I played with mod_perl in Apache, and was quite surprised that I can access my perl script, it would work perfectly, until I hit the refresh button on my web browser, and things would break... WTF? The code is fine, of course it is, but the memory variables are all over the place, so no wonder things would end up in a steaming pile of crap.
So in short, I'm now converted... I promise that from this day forward, any script that comes in contact with me will have use strict; added to the top. I will tell all that cross my path that this is how it should be. It makes you a better coder, it makes your code better, and forces the universe to be aligned with your goals. use strict || die;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: My confession - I'm now strict-ing...
by JavaFan (Canon) on Jan 25, 2010 at 08:16 UTC | |
by moritz (Cardinal) on Jan 25, 2010 at 11:07 UTC | |
by Jenda (Abbot) on Jan 25, 2010 at 09:51 UTC | |
by JavaFan (Canon) on Jan 25, 2010 at 10:09 UTC | |
by dsheroh (Monsignor) on Jan 28, 2010 at 08:38 UTC | |
by JavaFan (Canon) on Jan 28, 2010 at 09:11 UTC | |
|
Re: My confession - I'm now strict-ing...
by locked_user sundialsvc4 (Abbot) on Jan 29, 2010 at 18:21 UTC |