Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You listed your main concerns as maintenance, code size, and flexibility. I love CGI::Application for precisely those reasons. The great thing about the module is that it gives you a structured way to organize your code, while at the same time being very lightweight and flexible.

Prior to using CGI::Application, my team had a lot of ugly CGI and mod_perl scripts that looked like big switch statements:
if (we're in this state), do this...elsif (we're in another state) do something else... But that's very messy to read and maintain. It's hard to know which states the script handles. Someone could easily add a state and not document it properly.

What I love about CGI::Application is that it lets me follow the creed "the code is the documentation." If one of my team members shows me a CGI::Application program, I can immediately identify what "runmodes" it handles, find where it handles them, and I know where to find everything. Similarly, when designing a module for someone else to program, designating runmodes and succinctly describing them, gives the programmers what they need. When they bring the program back to you, it's easy to check where they are and what they've done.

Like I said, one key is how lightweight CGI::Application is. It adds a lot, but doesn't detract.

As for HTML::Template, I use it a lot too. It replaced my own kludgy way of instantiating Perl vars in my HTML. I've noticed people get confused by the TMPL_LOOP tag a lot, which it HTML::Template's way of allowing you to repeat rows. Just read the docs carefully, and it will make sense. I've used these modules on both large and small sites. You mentioned 10+ runmodes as a benchmark, but I rarely program with more than half a dozen. I usually prefer to break things into multiple smaller applications, rather than one big app, but I don't see any issue with scaling to 10+ runmodes.

In reply to Re: CGI::Application and HTML::Template by suave
in thread CGI::Application and HTML::Template by nop

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 browsing the Monastery: (7)
As of 2024-04-18 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found