|
Posted by ninja on 08/10/06 09:08
s a n j a y wrote:
> > You wouldn't have truly mastered PHP if you hadn't mastered regexp.
>
> I disagree. I have worked as a sr developer on a project written in php
> and java. This project was and still is bigger than any projects I have
> seen so far, that including all the open source projects. We used as
> minimal of regex as possible.
Well, I guess that's precisely why it got so big in size :)
> I personally hate regex. It is like a bad
> programming practice and if you are a bit out of touch with it, its hell
> to revisit the code and understand it.
>
> I wouldn't attach that great a significance to regex.
Seriously now, you're entitled to have an opinion, and I respect that.
It is true that regexps can't (and shouldn't) help you much when you
need to test integers or do something like that. However, regexps *are*
the most powerfull paradigm available for handling string (as in, text)
data.
I agree it's hell to revisit code with regular expressions when you're
out of touch with it. But it's also hell to revisit code if you're out
of touch with arithmetic or boolean operators ;)
My point is, one should use the *right* (as in, the best possible) tool
for the job at hand. If you deal with text data, chances are that this
means you should use regular expressions.
You haven't truly mastered a language that gives you an opportunity to
use regexps if you can't fluently read and understand them. Just like
you haven't truly mastered a language that offers you a 'multiply'
operator, but you'd still rather use "for" loops and addition instead.
Avoiding regexps by all means sounds just like that to me.
At least this is my opinion and, once again, I respect other opinions
as well. However, I really think Chung Leong is right:
> You wouldn't have truly mastered PHP if you hadn't mastered regexp.
Navigation:
[Reply to this message]
|