|
Posted by Andy Jeffries on 06/21/06 13:12
On Wed, 21 Jun 2006 13:48:00 +0200, Rik wrote:
>> It is to me, I'd always thought regexs were slower. Bugger, that means
>> I will /really/ have to get round to learning them.
>
> Yup, I'm quite capable to produce some regexes, but in all testcases I saw
> where it could be done without, regexes seemed slower... Time to test some
> past code.
I always prefer them as it's generally a lot more readable (a single line
of code compared to 10 lines of iteration). In most cases developer
comprehension is more important than CPU cycles (unless you're working
with masses of data, but that's not normal in a web system).
The obvious comment coming is "regexes are more readable, what a load of
BS" - but they are if you understand regexes, and if you don't - it's not
my fault you are lacking in a skill (with "you" being the developer coming
to look at my code for maintenance).
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|