3 ms·
Isn't it interesting how React has changed the whole paradigm of "keep html out of javascript"?
by 2pointsomone 10y ago
Isn't it interesting how React has changed the whole paradigm of "keep html out of javascript"?
- Swizec 10y agoYes and no. Ideally the main logic part should have none of the html-like part. Views should be dumb and do as little as possible. Of course in practice ... This is def a lot better than what I currently use in production: Handlebars hacked to the point of almost being JavaScript but not really. Then you both have views with too much logic and they're annoying to implement. At least with React you get the full expressiveness of JS right in your views.
- wereHamster 10y ago> Views should be dumb and do as little as possible. Yes, just like React advocates.
- BigJono 10y agoI played around with a lot of different architectures for my React applications, and eventually ended up with something very close to traditional MVC, with components that are either view components, or controller components, but not both.
- kowdermeister 10y agoIt's just about personal taste. MVC is fine, I've built quite a few apps with that approach. JSX is weird but I still find it a viable approach. #nosilverbullet :)
- kowdermeister 10y agoI ditched handlebars because of that. I used dust and some twig implementation.
- vladimir-y 10y agoWell it's well known that Facebook is familiar with PHP and I guess with the oldschool PHP mixing code and representation approach. So why not introduce that approach into the React then :)
- Dr_tldr 10y agoOnly if you're so ignorant of how React works that you don't realize the JSX isn't HTML, it's syntactic sugar/an alias for the React.createElement method. It's no different than $(<p>) in jQuery, so unless you're referring to some pre 2007 attitude, what are you talking about?