Hacker News new | past | comments | ask | show | jobs | submit login

Text templates are the technology for web development. They are so much better than anything else that there's no comparison.

There are some bad templates implementation, and some good ones. The original PHP and ASP are bad. But that doesn't mean templates are bad.




Text templates are a good idea, placing them into the middle of JavaScript code, not really.


I absolutely disagree, but I also feel it's unfortunate that HTML, CSS, and SQL aren't first-class citizens in most languages. It's strange to treat things backed by entire standards bodies and with fully developed ASTs as plain-text.

It seems unnecessarily limiting, and I'm not sure why; For the sake of history? "Division of Concerns"? How is it that using libraries meant for string manipulation upon a standardized format not a concern in and of itself?

The reason JSX, Mithril, PHP's template tags, ASP, Mustache, Twig, etc, exist is because we want to generate HTML - a language that has been standardized for decades - so why are we still playing around with string manipulation tools?


It's an evolutionary constraint. Text templates are initially much more useful than HTML and CSS ones, so people adopt the first, despite a bigger potential usefulness of the later.

The tendency for SQL is even weirder, it's for replacing it with languages that are much less useful for querying data.


We aren't, only those that keep fighting against MVC, HTML Templates and Web Components are.


I do agree with that. But on the case of JSX, it is located inside JS code, but is completely self-contained, thus, it's not as bad.

The original PHP and ASP are really singular beasts, people aren't creating things like those anymore.


What do you consider some of the good ones?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: