Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Substituting a comma only when it is preceded and followed by a bracket

by BrowserUk (Pope)
on Nov 03, 2011 at 18:12 UTC ( #935735=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Substituting a comma only when it is preceded and followed by a bracket
in thread Substituting a comma only when it is preceded and followed by a bracket

Code written in this way would be instantly apparent to anyone who encountered it,

Aside from the fact that [^)]+   ## all non-close paren chars would mean nothing to anyone who doesn't have at least a passing familiarity with regex notation, writing every regex out this way in production code would be bordering upon the criminal.

I can't think of a single other occupation where apparently sober, experienced exponents suggest that they should do their work such that a beginner can immediately understand everythng they did without expending a little effort.

Take music. When starting to learn to play an instrument, you are likely to be given a score that looks something like this.

But no musician would advocate giving that to professional musicians instead of this.

Do you expect employers to pay for you to spend 10s of minutes of their time formatting and annotating a regex over 20+ lines of their source code, when it took no more than a few seconds to type it -- including the time it took to work out what to type -- on one short line?

When someone is learning and asks for help, I have no problems at all in expending time and effort annotating that line of code -- for them.

But wasting time and effort writing every line of production code as if it might one day need to be understood and modified by my 8 y/o niece, or the guy that came to fill the water cooler -- just in case. I've more respect for the use of my time and my employer's money.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^5: Substituting a comma only when it is preceded and followed by a bracket
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-12-28 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls