Hacker News new | ask | show | jobs
by austincheney 2339 days ago
A template language suggests something that uses code points to inject dynamic values. JSX is a bit more than that in that it bundles a template plus the corresponding assigned logic. It is more of a component language than a template language.

At any rate the reason why somebody might want to do this is purely because its declarative. I prefer imperative programming myself, because I want to know exact what the logic is doing from reading the code, but many people don't think that way. Many people want to know what is happening without being overwhelmed by how its happening and they need the code to communicate to them in exactly that way.

1 comments

In my opinion, the power of the React/JSX model is really about allowing you to declaratively specify everything that can/should be specified that way. But then also allowing you to selectively use imperative constructs where they're needed, all while making it fairly seamless to move back and forth between the two at any level of abstraction.

Of course, with great power comes great responsibility...