by tchaffee · 9y ago · 0 comments
I find JSX to be more readable. "Tags as first class functions" means I have to parse the functions into HTML as an extra mental step when trying to understand the structure and elements that make up the view.
<there class="is-no"><extra>Mental Step</extra></there>
Currently aside from JSX and things like mustache some devs are using h https://github.com/snabbdom/snabbdom#inline-example and Cycle has a syntax not far off from what I'm proposing http://widdersh.in/tricycle/ . But the syntax is not actually the big deal, the biggest benefit is the complete separation of logic from semantics.
I don't expect everyone to like it but I don't think it's horrible or difficult to look at when used in a real project.
Then maybe allow JSX? The way I write my React components, the view is what you find in the `render()` method, and there is little to no logic there. The big selling point for me with React is that I no longer have to learn yet another templating language. Which seems to be somewhat where you are leaning as well. But being able to read HTML as, well HTML (or something very close like JSX), has a lot of benefits. Just going between code and the browser debugger for example. The mental step of translating between what I see in the browser and what's in my code, is in fact a step.