That’s fine, it sounds like you would prefer another view framework. React isn’t for everyone as it makes some opinions. Like I said, the huge shift isn’t JSX, it’s a minor detail. It actually came after React as a thing to make it easier to write (than functions).
First, React apostles told us that keeping our JS and HTML in separate files is wrong, because it’s better to organize things when they are together.
I don’t recall anyone saying it’s wrong, it’s more about efficiency. If you have UI broken up into smaller chunks you’ll have more files. If have JS and HTML files you’re doubling the number of files and making it hard to tell what’s going on with logic. There is also more tabs open in the editor and more file jumping. This is an opinion of the framework. I hated it at first but now prefer it.
Then they told us that we should in fact have two components, a parent one responsible for data and a child one responsible for the view. So we ended up with same two files that we had, but now both with mixed JS and HTML and with additional div wrapper for the outer component.
Again, this is an opinion of the framework and is not necessary. The reason this is suggested is because it separates app specific logic from generic logic. It’s opinions like this that make React a more maintainable solution. You can put all of your code in one file if that’s what makes you happy; for small apps that might be better too.
For example, if an app has a todo list you can make a ‘container’ component that only handles getting the data from the server for that specific use case/page. Then
TodoList only has to have logic for laying out the
Todos. This means you can use the TodoList anywhere else in the app (or a diff app) and the other instance only needs a different container wrapper to get the data it needs for that use case.
If code golf is your goal, React is not the framework to choose. It’s optimized for maintainability instead of terseness. I wish Blaze was built for maintainability in mind.
Building new features is easy; maintaining features is hard. I think it’s refreshing to see a framework focus on maintainability (and likely this is why I find React a fit for my team).
Makes me wonder what wheel they’re going to reinvent next.
Most likely whatever is making maintaining Facebook difficult, regardless of dogma.