Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • 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 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?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-19 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found