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.
  • At least, the two places I've worked at that used TT (Socialtext and LiveText) both had gobs and gobs of logic in the templates. And TT's crippled language made dealing with this much harder than dealing with the same thing in Mason, since at least with Perl you have a sane language to use.

    People keep saying TT helps with this problem, but I have yet to see a good example of using it cleanly.

    • by abw (998) on 2008.11.30 6:50 (#66045) Homepage

      I agree that there are people who abuse TT by putting application logic in templates. But given enough rope, there will always some people who end up hanging themselves, or at best, tripping themselves up.

      TT's language is deliberately "crippled" because it's a presentation language, not a programming language. And the fact that TT makes it so trivially easy to write and use a plugin means that no-one should ever be doing "programming" using TT.

      But they do :-(

      However, that fact that some people don't use the tool properly doesn't imply that the tool is broken (although I accept that some of the blame may lie at the feet of the tool designer for not making it's intended use more obvious, or fitting it with a suitable anti-hanging device).

      But the underlying principle of separation of concerns is sound. The skill is in knowing how far to go in separating a system without reaching the fragmentation ceiling, where the overhead incurred by having something split into a jillion files outweighs the benefit. This is not always simple or straighforward, but then neither is programming in the large.

      Sometimes doing it "all in one" in the style of PHP or Mason is the right way to do it, particularly if you're not bothered about being able to re-skin the application, or splitting the workload between designers and programmers. But it's not the right way to do it if you are.

      • I think the TT has the fault lines at all the wrong places. Templates have three classes of complexity: static text (obviously a large part of the output); simple interpolation and undemanding logic (loops, conditionals; very common as well); and then hairy complicated formatting stuff with lots of little conditionals and munging and all sorts of wiry bits poking out of the data (common, but only in small amounts). The TT language is far more powerful than necessary for the simple logic but not enough to ha

        • Display logic needs the same facilities for abstraction as business logic.

          Some days, it seems that only four people in the world understand this. (The third is Avi Bryant.)

      • I am convinced there's no such thing as a perfect separation of application and presentation logic.

        That said, we've done quite well with TT in Slash over the years.