[Baypiggies] More dramatic material?

Glen Jarvis glen at glenjarvis.com
Wed Feb 24 16:04:06 CET 2010

> The other important thing to remember about regular expressions is  
> that
> even if you use verbose regexes split across multiple lines, regexes  
> are
> functionally write-only for even the vast majority of experienced
> programmers.  (I.e. almost nobody can look at a complicated regex and
> understand what it does.)

I agree. Regex's have been my weakness forever because it just isn't  
readable like python is readable. They just feel so unpythonic.

I'm always trying to fill in the fundamentals and I've been learning  
to do fairly sophisticated regex's the past six months... However, my  
fundamental question of 'why use it on Python' has been echoing in my  
mind more and more with this conversation. Richard Pixley gave a few  
reasons other than performance.

I'm hoping there will be die hard fans somewhere here to give  
compelling reasons to learn it. I know we can find them in the Perl  
camps -- that's logical considering that Perl grew out of a desire to  
supplement awk. But, it's also a Python module.... So someone must be  
a die-hard and can defend 'why do it in Python' and give examples.



> Remember:
> 'Some people, when confronted with a problem, think "I know, I'll use
> regular expressions."  Now they have two problems.' --Jamie Zawinski
> Sometimes regexes are the best way to solve a problem, but you  
> really are
> best served by trying other options first.  In many cases, people  
> want to
> use regexes when they should be using a full-blown parser because  
> regexes
> require less up-front investment.  Just remember that you'll get into
> technical debt and pay more later.
> http://en.wikipedia.org/wiki/Technical_debt
> -- 
> Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/
> "Many customs in this life persist because they ease friction and  
> promote
> productivity as a result of universal agreement, and whether they are
> precisely the optimal choices is much less important." --Henry Spencer
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies

More information about the Baypiggies mailing list