Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • What you're probably seeing is someone's first approach or someone who refuses to grow in their skills (which your post should help enlighten). I look at that first example and am repulsed, but at the same time, I remember writing code like that when I first started w/ MVC.

    I'm a big fan of CGI::Application, where you write subclasses that are Controllers. Within that subclass, you write subs that handle states of the webapp and yeah, when you first pick it up, you find yourself putting HTML and SQL code in there, but as you learn and evolve, there's either support built-in to cgiapp or plugins that offer support for templates, db abstraction, etc.

    - Jason
    • That's another reason why I rather like Catalyst and Jifty -- cleaner separation of concerns. While CGI::Application doesn't do as much heavy lifting, it still seems like a much better idea that what most folks do. Plus, if you can at least remember to keep the three logic types in their appropriate layers, you make refactoring much easier because of the looser coupling.

      And years ago, I wrote code like my first example, too. In fact, I remember when chromatic came and worked at the same company I did a

      • Any deployed codebase used by actual customers and funded by people who won't put up with infinite deadlines has some technical debt. Your code wasn't the problem. (At least, I can't remember ever having to fix a bug in code you'd written.)