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
|
|