4 ms·
A few of these points are a bit off. React isn't against templates - the existence of JSX is counter to this. React does choose to consume templates in an imp
by Bahamut 12y ago
A few of these points are a bit off.
React isn't against templates - the existence of JSX is counter to this. React does choose to consume templates in an imperative form (via React.DOM), and JSX is meant to ease this flaw in productivity by giving tooling that corrects this unnatural form of development (for most frontend engineers).
React is also not against separation of concerns - even in the talk by Pete Hunt linked, he merely has a different view on what constitutes the concern of the view layer. His viewpoint is that the template and the state of the component are intertwined heavily, so as to stress that Facebook's approach with React does not break that principle.
- jasim 12y agoThanks 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...