The problem with the "right way" is that it's a slippery slope. Do I really need an XML parser if I'm given a simple chunk of XML to deal with, or are regexes sufficient?

Personally, I'd prefer pre-built XML parser to rolling my own, especially after the "simple chunk of XML" becomes more complex.

Do I really need a database for a simple content management system, or are would flat files work adequately?

Well, it depends on the definition of simple. If you're doing something for your own personal site, sure, why not. I didn't even use a database for mine, I used a "nested-template" based solution that I whipped up myself.

Do I really need to use CGI if I'm doing something simple inside the firewall? The "right way" adds weight that isn't always needed.

Yes. Why do work that you don't need to? It takes me about 12 and a half seconds to type:

use CGI; my $q = CGI->new; my $param = $q->param("param");

And the best part is, I don't even need to think about it. And I know it won't break if I ever have to use it outside the firewall. Why would you roll your own version of this well rounded wheel, especially if you know better?

I guess what I'm really trying to say is that it really depends on the situation. Sure, you're friend's mini web server worked great, and theres certainly nothing wrong with a piece of code that does exactly what it is supposed to do to solve the problem at hand, even if it is incomplete in the broad sense.

However, when people come here for help, it is a different situation. I most certainly expect that should recieve the most complete, accurate information on the "right way" to solve the problem. Why should they get anything less?


In reply to Re: Simplicity vs. Doing It Right by jryan
in thread Simplicity vs. Doing It Right by dws

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.