13 comments

[ 5.7 ms ] story [ 60.9 ms ] thread
Yet another ASP.NET flavor?
Well, yes. Which is better: options, plugins and experimentation; or only one way to do it?
I'm not against ASP.NET or this Razor syntax, but is this really HN material? Honestly folks, I'm clueless about how this got to the front page.
Ruby and Python templating engines are better.
Haml/Sass is the best thing that happened to my view layer (next to wonderful Ruby blocks, iterators and chaining)
How so? I haven't used them and I wouldn't mind reading a comparison.
The driving philosophy of these engines is that your presentation layer should not contain any logic that goes beyond the rendering of data, and your templating should be an aid to outputting HTML, not merely a medium.

Take Django templates, for example: you output data using tags and filters, with support for defining commonly-used blocks of HTML to reduce redundancy. Take Haml, which uses CSS selector syntax to reduce the amount of HTML boileplate to a bare minimum.

The common factor of these engines is that your end up writing less code than plain HTML, and unlike this new engine for ASP, the mixing of code and presentation doesn't look completely horrendous.

ASP.NET is finally getting the idea of alternative template engines. That is one great point about Python, Ruby, PHP etc is there are many template alternatives for all levels of simplifying templates so that they aren't so glued to the controller or renderer.

This makes it easy to swap out basic html/javascript templates and use them in complex systems without mounds of work.