in reply to Optimization for readability and speed (code)
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.
|Replies are listed 'Best First'.|
Re (2): Optimization for readability and speed (discussion)
by deprecated (Priest) on May 01, 2001 at 00:15 UTC