Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
There's more than one way to do things
 
PerlMonks  

Re: Best practice or cargo cult?

by Herkum (Parson)
on Jun 20, 2006 at 14:50 UTC ( #556412=note: print w/ replies, xml ) Need Help??


in reply to Best practice or cargo cult?

While xms may not always be needed, that does not mean you should not bother using it UNTIL you need it. You will become confused when you forget to use a switch, wasting time debugging becuase you used x instead of xms.

If you use xms all the time, you will be consistent in your code and your expectations.


Comment on Re: Best practice or cargo cult?
Re^2: Best practice or cargo cult?
by Juerd (Abbot) on Jun 20, 2006 at 15:07 UTC

    While xms may not always be needed, that does not mean you should not bother using it UNTIL you need it. You will become confused when you forget to use a switch, wasting time debugging becuase you used x instead of xms. If you use xms all the time, you will be consistent in your code and your expectations.

    Using /xms by default only turns things around. It doesn't fix anything, except apparently many of Damian's regexes. I don't have any global statistics, but I do know for sure than in my code, I don't need /m and /s in more than 95% of all of my regexes.

    /xms on by default just changes the default. Instead of turning flags on when you need them, you start turning them off when you don't need them. And you're caught in exactly the same debugging thing. Not that I ever spent a second debugging this, though: I'm very clear about what I expect. When I write /s, that's a clear indication of how I expect Perl to handle my ., and when I don't write /s, it's clear that I wanted the other thing.

    /m communicates to the reader of the code that the string is conceptually multi-line (as opposed to, for example: filenames, XML tags, etc...). Well, it used to, before PBP spread this nonsense.

    Juerd # { site => 'juerd.nl', do_not_use => 'spamtrap', perl6_server => 'feather' }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-04-21 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (493 votes), past polls