4 ms·
Well I can understand why you think some templating languages are hideous, because they definitely are. Many are overly verbose. I've definitely enjoyed a few
by Pewpewarrows 16y ago
Well I can understand why you think some templating languages are hideous, because they definitely are. Many are overly verbose.
I've definitely enjoyed a few though, Django's being one of them.
I think Javascript templating is great, and it's certainly helpful in many ways, but it could never flat-out replace server-side template engines for me. In Django for example, you almost always pass whole ORM objects to the template. On someone's page of a list of friends, I'd loop through a collection of User objects and generate an html list of usernames and permalinks to their profile pages. If I passed the whole collection of User objects to the client they'd get access to a lot of sensitive information. Which would require me to white-list at the ORM level exactly what fields I might need ahead of time. That might work, but I'd always be worried that I didn't clean the objects sent to the client's JS template enough for every page I'm writing.
Unless of course you were going for the idea that we'll be using one universal templating language both for the front-end JS as well as on the back-end in something like node. In which case disregard everything I just wrote.
- atomical 16y agoIt won't degrade gracefully for those who turn off javascript or don't have it. Putting more and more things into javascript may be in vogue but it doesn't seem any better than the solutions we already have.
- Pewpewarrows 16y agoYep, definitely another reason not to leave the entire template render to Javascript.