Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Best practice or cargo cult?

by Juerd (Abbot)
on Jun 20, 2006 at 15:07 UTC ( #556423=note: print w/replies, xml ) Need Help??

in reply to Re: Best practice or cargo cult?
in thread 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.

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 => '', do_not_use => 'spamtrap', perl6_server => 'feather' }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://556423]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2017-12-17 06:23 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (462 votes). Check out past polls.