News for hackers. Stuff that matters.
Re:Tempo: a tiny JSON rendering engine by etherealG on Monday March 21, 2011 @05:22AM (#2348997)
sorry to be a hater, but while I find the idea of mixing js and html not great, the alternative being offered up here is to introduce a new language and mix that in with html instead of js. isn't that counterintuitive? wouldn't it be better to just use actual js in your templates instead of this arbitrary {{}}-based stuff?
Re:Tempo: a tiny JSON rendering engine by biot on Monday March 21, 2011 @06:06AM (#2349066)
It's a very familiar style of markup that I find immediately intuitive. The benefit being that it separates the markup from the code populating it.
Re:Tempo: a tiny JSON rendering engine by weego on Monday March 21, 2011 @07:05AM (#2349181)
{{tag}} is not "valid" markup (it will pass a validator but has negative semantic value), which is even worse than mixing a little well crafted logic into your display code.
Re:Tempo: a tiny JSON rendering engine by biot on Monday March 21, 2011 @07:31AM (#2349239)
Using {{tag}} notation seems to work well enough on Wikipedia -- could you elaborate on the difference between Tempo's use and Wikipedia's?
Re:Tempo: a tiny JSON rendering engine by etherealG on Monday March 21, 2011 @11:34AM (#2350148)
I don't seem much difference, but I also prefer when making websites to keep down the number of languages I have to know. Already html + css + js + a server side language is enough, introducing another seems excessive when your templating language could just be js or perhaps the same server side language you already use.

we do the same for our server side templating when making sites, using php for controller & model code, but also arbitrary php as the template language in the view too. it seems to work well, and avoids the need to learn something new.