Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Optimization for readability and speed (code)

by Masem (Monsignor)
on Apr 30, 2001 at 22:41 UTC ( [id://76703]=note: print w/replies, xml ) Need Help??


in reply to Optimization for readability and speed (code)

<insert all of merlyn's comments here>. In addition to sticking to the RE, given the situation that you need to allow others to maintain this code, I would include in your comments the output of OGRE or some other such tool that english-fies the regex for non native regex speakers.

Also, I would try to make sure that you grab as much as you can from the regex even if your code now does not currently need it. Say that you have a 5 field line, separated by white space, and your app currently needs only 4 of the 5 fields. I would still declare and grab all 5 fields, with commenting describing what the field is given the input format. This way, if it needs to be modified down the road to use the 5th field, they simply need to start *after* the regex, instead of possibly messing up the regex and causing the other 4 fields to be inaccessible.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
  • Comment on Re: Optimization for readability and speed (code)

Replies are listed 'Best First'.
Re (2): Optimization for readability and speed (discussion)
by deprecated (Priest) on May 01, 2001 at 00:15 UTC
    I've tried to get to OGRE before, and as far as I can tell it's broken. Any word on this?

    -dep

    --
    Laziness, Impatience, Hubris, and Generosity.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found