Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

That is a horribly poor comparison. You simplify for an 8-year old because he is probably unable to comprehend the real answer. A beginning Perl programmer is presumably and adult and shouldn't need the simplification. They will benefit more from being shown the right way to do things from the start.

Plus, your solution was not a simplification, but the wrong way to solve the problem. See the hundreds of posts detailing why you shouldn't use regular expressions to parse XML.

I would much rather the beginner have to work a little harder to learn the right way, than to be stuck six months down the line when everything blows up because someone added an attribute to the XML. or even a newline

And actually, I would not even call ikegami's solution harder to understand. Sure, it requires you to actually read a PerlDoc to understand it,but how lazy (the bad kind, not Perl Lazy) do you have to be for that to be the issue? And there is no reason why the user couldn't learn by replying with follow up questions about the code and the idioms used; thereby learning more and creating robust code.

With your method, the beginner gets a fragile one-off that reinforces a bad methodology. With ikegami's he learns a valuable tool that can help him solve more complex problems safely and easily

Your comment elswehere in the thread is telling:

Why oh why, do you need all that complexity to do a simple task? WHY???? I refuse to learn how to write code which has to be that verbose, without some sort of damn good reason! ... What ever happened to keep it simple?

your good reason is robustness and reliability. Keep it simple is secondary to do it right.



-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

In reply to Re^15: Processing Two XML Files in Parallel by dreadpiratepeter
in thread Processing Two XML Files in Parallel by tedv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-06-26 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (85 votes). Check out past polls.

    Notices?