3 ms·
Thanks for your thoughts. I should clarify what I meant by templates. Templates are driven by content, not by logic, and they are typically monolithic. This wo
by jasim 12y ago
Thanks for your thoughts. I should clarify what I meant by templates.
Templates are driven by content, not by logic, and they are typically monolithic. This works well for web pages which are about content which doesn't have much JS. The web was historically content-driven, which has started changing only recently with the evolution of Javascript and the emergence of web-apps. This historical quirk is why imperative construction of the view is unnatural form for developers. This is however going to change fast, because imperative view construction is the natural way to build web apps.
JSX templates are templates in the sense they do minimal string interpolation. Everything else is taken care of by programming language abstractions. They include control structures: conditionals and loops, and primitives for abstraction: variables, functions and objects. A template 'programming' language on the other hand is a suboptimal mix. For example, Angular's templating language reminds me of Greenspun's 10th rule, which with suitable modifications, can be read like this:
Any sufficiently complicated templating language contains an ad hoc,
informally-specified, bug-ridden, slow implementation of a
turing complete programming language.
I cover the above perspective in detail here: http://www.jasimabasheer.com/posts/evolution-of-view-templating.html http://www.jasimabasheer.com/posts/evolution-of-view-templat...