You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is a personal subject and it's very easy to swap out template engines; however, Express does have an outdated template engine and would benefit from a change. I believe the best candidate for a new default is EJS - below are some reasons to why.
Popularity
EJS currently has the widest audience on NPM by a large margin.
Any other option is inconsistent with Node and Express
Using a template engine that introduces different syntax/structure makes little sense. Embedded JavaScript is similar to ERB - used in Ruby on Rails - and, IMO, should be the default in a server-side JavaScript framework.
Some candidates are inconsistent altogether (to me)
Handlebars, for instance, tries to "separate concerns" as if this is the HTML/CSS that's in the browser. Yet, it lets the use of some logic in the templates through if blocks, for loops, and custom helpers. Also, even if it was consistent, why separate them in a template engine? It spits out pure HTML/CSS anyway, which itself is enough separation of concerns for the end product. If the reason is to be portable, I can't say much, other than to show EJS's popularity.
Again, this is would be a small change, but that does not make it unnecessary. Feel free to add your opinions below - it doesn't have to be EJS!
The text was updated successfully, but these errors were encountered:
I know this is a personal subject and it's very easy to swap out template engines; however, Express does have an outdated template engine and would benefit from a change. I believe the best candidate for a new default is EJS - below are some reasons to why.
Popularity
EJS currently has the widest audience on NPM by a large margin.
Any other option is inconsistent with Node and Express
Using a template engine that introduces different syntax/structure makes little sense. Embedded JavaScript is similar to ERB - used in Ruby on Rails - and, IMO, should be the default in a server-side JavaScript framework.
Some candidates are inconsistent altogether (to me)
Handlebars, for instance, tries to "separate concerns" as if this is the HTML/CSS that's in the browser. Yet, it lets the use of some logic in the templates through
if
blocks,for
loops, and custom helpers. Also, even if it was consistent, why separate them in a template engine? It spits out pure HTML/CSS anyway, which itself is enough separation of concerns for the end product. If the reason is to be portable, I can't say much, other than to show EJS's popularity.Again, this is would be a small change, but that does not make it unnecessary. Feel free to add your opinions below - it doesn't have to be EJS!
The text was updated successfully, but these errors were encountered: