http://www.perlmonks.org?node_id=914219


in reply to Moores Law, Perl and the future

Regexes aren't evil in this case because they're slow. They're evil because it's incredibly difficult to correctly parse XML using regexes. In a language with stricter regexes, it'd be impossible, but in Perl's extended regexes, it's merely very, very difficult.

I don't take people seriously who talk about what they're going to do. I take them seriously when they talk about what they've already accomplished. So far, your entire output has been polluting Meditations with successive walls of text, plus a zip file with Perl code demonstrating terrible coding practices.

After cutting out the ranting about 486s, Moore's Law, and the herd mentality, I see a potentially useful templating system. But not a particularly remarkable one. It looks like Lisp done in XML, something that would be recognizable to someone who read the first chapter of Structure and Interpretation of Computer Programs. It hardly justifies all this talk of heretics and blasphemy.

tl;dr: please stop spamming Meditations. If your ideas have merit, then go code them up in a package that doesn't parse CGI parameters by hand and demonstrates knowledge of placeholders and context free grammars.


"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^2: Moores Law, Perl and the future
by ikegami (Patriarch) on Jul 13, 2011 at 23:54 UTC

    They're evil because it's incredibly difficult to correctly parse XML using regexes.

    Not at all. Writing an XML parser using regular expressions is definitely no harder than writing one that doesn't. It's writing an XML parser (compared to using an existing one) that's hard.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^2: Moores Law, Perl and the future
by sundialsvc4 (Abbot) on Jul 15, 2011 at 01:52 UTC

    I think that it would be better to say that, “whether or not you can parse XML using regexes ... from an engineering perspective that is not the point.”   When you are developing a piece of computer software that needs to process an XML file, the single most important consideration that you have is to minimize your exposure to project failure.   If you have at your beck and call a package of software that accomplishes a particular task (as evidenced by its ability to pass 15,385 (or somesuch) internal self-tests, and if you can get all that just by uttering the magic words, use XML::Twig, then, “point, set and match!”

    This is the very same reason why there is a viable and important business in making pre-hung doors and even, in some cases, pre-finished walls and houses.   At the end of the day, you just want to deliver results.   You want to collect your final check, go to the pub, and not worry about being interrupted as you get a wee bit pleasant, because you know that every promise you made to your customers was kept ... and that you made a modest profit doing it.