The release of Rails has proven a riotous success, if you define success as stirring up the pot on what makes a good web application framework. Ruby Talk has been abuzz with good discussion about the virtues and vices of tags + bindings (ala CGIKit and Iowa) vs HTML + code (ala eRuby and Rails). One shouldn’t forget the Borges end of the spectrum either: pure code.
David Heinemeier Hansson has responded to my previous post about Rails, and I will apologise for the ASP-clone comment up front – twas a bit harsh, and it came from the depths of my disappointment. His references to my name made me realise that I haven’t put my full name anywhere on my damned blog. David – I too am a David. David Naseby. And as I said, I will take more time to investigate when I can run it on Webrick, instead of Apache.
I’m not criticising the release of a well-tested, working library. Never would. I’m not criticising a library for having precendents, or for not being revolutionary. Indeed, I’m not criticising Rails at all. I’m just stating that it, as a web-application framework, doesn’t fit with where I see web app frameworks as needing to go. I’m sure that I could use it pragmatically if I wanted or needed to, and given David’s track record with library development, it would be a pleasure to use. Ruby must compete with a whole bunch of other languages that I could spend my spare time with. So boredom and pragmatic excellence are not my criteria for selecting the frameworks I’d like to play with. Don’t worry at all about losing my interest David – I am not your target audience.
Returning to the subject of my intro, rather than a semi-personal blog-off with David, Gabriel Renzi, summarising Bauduin Raphael, nailed my point of view on the tags + bindings vs embedded code with this post:
He’s saying that he does not want to have ‘foo’ referencing something real (i.e. the parameters passed to the page) cause that adds coupling beetween the view logic and the business logic. ... He just prefers to have that level of indirection where he can have ‘foo’ as a placeholder for, say, a ‘show=true’ passed to the page or a Time.now==XMas_day or a sql query result. You don’t like that level of indirection and it’s ok (I think I agree), but it’s not really a question of presentation logic in template languages or in real programming languages.
I’m not questioning ease of use. Its more about the platonic ideal – what’s the Right Way to do this? James Britt followed up with a good reasoning of my ideal, in this post
My particular preference for templating tools is something that lets me check the validity of code and markup independent of each other (knowing, of course, that the combined results must also at some point be checked). I’d rather not have to “compile” a page each time I want to verify that HTML attributes are properly quoted, or that there are no syntax errors in the code.
I can’t think of a framework that lets me have that level of freedom. I’d love to meet it though. I know Narf emphasises testability, and code – HTML separation. I don’t really like the way it handles forms (which, attentive readers may notice, is my primary criticism of web app frameworks that aren’t Iowa or Borges). And I also don’t know if it provides the levels of separation that the ideal demands. But its certainly worth a peek, as much as all of the aforementioned frameworks.