Liquid templates? Why?
I’ve had some colleagues insist that Liquid Templates for Rails are the way to go? I’ve not heard any convincing arguments, other than the opinion that its flexibility and non-verbosity is a big asset in having cleaner View code. Personally, just the fact that it REEKS of Smarty in PHP is something that I want to avoid. You are coding in Ruby, why not preserve the homogeny of your application’s code by using standard ruby for all of the operations therein?
This leads in the direction of arguing the View’s importance in the MVC pattern outlined by the framework. A role which I am definitely not qualified to answer. In school we learn so much of the benefit of Data Structures, and their usage to solve problems of intense algorithmic complexity by abstracting related relationships and using innovative ways to iterate through those relationships. Those data structures were there for specific low-level purposes and algorithmic efficiency and thus, they were established and sacred (you change it, or use it incorrectly, you’d lose your algorithmic advantage, o(n) could become o(n^2) in no time!).
MVC is a structural advantage, one that serves a more ‘human’ purpose, of reducing the entropic nightmare of maintaing complex code and the interaction with developers and the system. Is preserving it, by strictly adhering to the separation of powers within, a matter of prime importance? I believe so, and in believing that, I will concede that I’m ANAL about keeping logic/processing out of the view templates. Something like Liquid or Smarty seem like such a violation of the MVC principles. At least in Smarty’s case, I’ve seen the horror of debuging processing errors in the TEMPLATES and not the controllers.
I will keep an open mind and try a few applications with Liquid. If I can find some systematic method to keep things clean and accessible for nubes, I’ll be sure to write up a tutorial!
Update: I’ve RTFM and I think I understand the purpose of Liquid Templates a bit better. However, PHB’s are STILL requesting its use on the merits of its Buzzword compliance. Its insane, I really wanted to be a part of this Web2.0 thing, but, its not really something you can force. You need a designer that thinks out of the box, a developer who’s open to new technologies, and someone to tie it all together who understands the meaning of the world ‘elegance’. At no point, should buzzword compliance enter the fray!
Leave a Reply