Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • I'm going to go broke buying books, you know. I suspect this one, though, will be well used and not just another dusty reference work on a bookshelf.

    Now if I could only get my company to go with TT instead of Mason ... nah, it'll never happen.

    • Now if I could only get my company to go with TT instead of Mason ... nah, it'll never happen.
      What's so bad about Mason, then?
      • by Ovid (2709) on 2004.01.07 16:28 (#27126) Homepage Journal

        The same thing that's wrong with Java: nothing.

        Java, like any language, has strengths and weaknesses. Some projects will be avoided or accepted in accordance with these. Some projects, however, will be avoided as a matter of personal taste. The latter is the major issue I have with Mason. For me, working with Template Toolkit is fun and easy. I just don't find Mason to be as straightforward, but that's probably because I learned TT first. For specific issues:

        I don't like that everything gets compiled into the HTML::Mason::Commands namespace. With multiple components for a single page, I sometimes find it confusing to figure out what's where.

        One (loose) way of looking at Mason is to think of HTML driving Perl, instead of the other way around. This can make it very easy to put too much logic into the HTML instead of merely having it as a presentation layer. I've found that with TT, I naturally put my logic into the Perl and just pass data to the templates. In other words, it encourages good style.

        I find that TT makes it very easy for me to embed templates in my programs when I need specific formatting for output (something I do quite a bit).

        On a personal level, I like the "mini-language" in TT. It's very clean and doesn't require the Web designers to learn Perl. I also appreciate that Andy Wardley has taken the time to handle some of the encapsulation issues well enough that you can transparently switch from accessing hashref keys to calling accessors without needing to change the template code (this has saved me a fair amount of time while prototyping.

        I also find TT very easy to test and profile since it's Perl driving the HTML and not the other way around.

        Really, though, these are personal gripes that stem more from my comfort level than with any deep knowledge of Mason. Anyone familiar with Mason can probably turn around and give me a similar list of issues regarding TT and I would probably not refute them.