Templating Schmemplating

Posted by Roy Hooper Mon, 10 Apr 2006 18:25:00 GMT

The last few days at work, I’ve been investigating web templating systems and web application development frameworks.

My searching for solutions ran me across quite a number of possibilities for both of these, too many to list really. Instead, I’ll just refer you to this list of MVC frameworks for PHP. Perl has just as many, the foremost being Catalyst.

I still haven’t picked one. I’m going to map our typical application out a bit before I decide if an MVC model suits us. It probably does, but anything we use needs to be:
  • simple
  • maintainable / easily understood
  • effective
  • fast to code with

Because I’m not the only one touching the code here, the 1st two points are key to us.

Moving on to templates. There’s even more choices here than for frameworks! I’ve classified them into 3 groups:
  1. embedded native code (eg Savant)
  2. non-html markup (eg Smarty)
  3. XHTML Markup (eg TAL such as ZPT or Petal or PHPTAL)

Right now, TAL looks the most promising because it looks like we can use it from PHP or Perl with the same template file. It also renders in the browser for testing, so creating them with any WYSIWG editor should work fine.

Learning Ruby

Posted by Roy Hooper Thu, 02 Mar 2006 05:22:00 GMT

I’ve recently been exploring Ruby. I thought that I’d try my hand at blogging with a purpose. That said, I’m going to blog my progress as I learn this intriguing language.  <br />
Ruby describes itself as a mix of Smalltalk, Python, and Perl.  Some of its syntax seems weird and awkward at first, but I feel part of that is due to the fact that its even more lax than Perl about its syntax.  One of the challenges I faced was finding a decent set of examples showing the syntax and quirks of the language in action.  I originally tried to use the online version of Programming Ruby, but I found that it was not a great choice for me.  I need examples, and plenty of them.

I managed to overcome some of the limitations of this gude through general surfing (I wish I’d kept track of those web pages), and through playing with irb.  Irb is neat.  I think it stands for Interactive Ruby.  Its a shell-like interface to Ruby.  If you enable tab completion, then irb becomes even more valuable to the learner, as you can explore the classes, variables, and methods more easily.
<br />More recently, I found a rather oddly written book, Why’s (Poignant) Guide to Ruby.  I find the banter to be horribly annoying, but after the first chapter I learned to skip over it.  Buried in between inane and unnecessary blather, there’s tons of examples, with decent explanations to boot.  I think Why could reduce the size of the book by over 75% and call it Why’s Concice Guide to Ruby instead.

Something else I played with is Ruby on Rails. I walked through the first two tutorials (first, second).  I’m not sure I like how automagically it does some of the database stuff, but I intend to learn how it works so I can override it all.  I’ll post about that when I learn about it.  For now, though, the most interesting thing I got was from scanning through Amy’s blog entry about the MVC: Most Vexing ConundrumMVC or Model View Controller is a design model that I intend to learn more about.

For now though, I’m still making my way through Why’s guide.