Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Why isn't C<use strict> the default?

by gothic_mallard (Pilgrim)
on Oct 28, 2004 at 07:23 UTC ( [id://403291]=note: print w/replies, xml ) Need Help??


in reply to Re: Why isn't C<use strict> the default?
in thread Why isn't C<use strict> the default?

Which is one of the things I'm definitely looking forward to when (if!;)) it appears.

These are lines that get typed in 99% of the stuff I write (unless there's a good reason not to) and if nothing else, hey, it'll save on finger strain.

I'm still amazed by the amount of people at my current place of work who don't use strict (experienced programmers and not just new hires). It makes life updating their work when clients require it a bit of a 'mare to say the least. If things like strict were default then my life would certainly be easier.

--- Jay

All code is untested unless otherwise stated.
All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
If in doubt ask.

Replies are listed 'Best First'.
Re^3: Why isn't C<use strict> the default?
by itub (Priest) on Oct 28, 2004 at 13:31 UTC
    These are lines that get typed in 99% of the stuff I write (unless there's a good reason not to) and if nothing else, hey, it'll save on finger strain.
    I always use strict for programs that are not of the -e type, and I'm a lazy typist. My solution was to tell my text editor (vim, but you can surely do something similar with others) to read from a template file whenever I try to edit a non-existent file ending on .pl. The template file includes the shebang line, use strict and use warnings. I also have a template file for *.pm with a little bit more stuff.

      Since you mention it, here's a snippet from my .emacs file.

      (add-hook 'cperl-mode-hook '(lambda () (define-skeleton perl-start "skeleton for a perl program" "" "#!/usr/local/bin/perl\nuse strict;\nuse warnings;" ) (local-set-key [(control c) ($)] 'perl-start) ))

      I do a similar thing in my editor also, but the problem is not us that know enough to decide that's what we want, but those that are just starting out and don't.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://403291]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-18 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found