4 ms·
I much prefer Angular's and Vue's templates over JSX.
by forgot-my-pw 9y ago
I much prefer Angular's and Vue's templates over JSX.
- ng12 9y agoWhy? I love JSX because it's a single source of truth -- 100% of the logic is in JSX. You never have to hop back and forth between the template and code to figure out how something is rendered.
- devoply 9y agosort of like the good old days where you did have to hop back and forth between javascript, css, and html. it was all in one file all inline.
- exclusiv 9y agoI think it's definitely a preference thing. Putting one language in another always feels dirty to me. On the other hand, many people feel sprinkling tags all over html is dirty and that the click handlers (v-on:click or ng-click) and other tags smell of yesteryear. For workflow I like to offload html/css production and when I get it back I can add VueJS or AngularJS tags to it and get busy. I don't have to chop it all up nearly as much. It seems much easier to have junior developers jump on VueJS templates too. While I prefer VueJS or AngularJS depending on the project, I'll probably try React on an upcoming project to get a feel for it and give it a shot.
- tomwilson 9y agoI agree it's a preference. But to me, the custom tags for loops etc is even more putting another language inside another than JSX is.
- exclusiv 9y agoGood point. I think that probably gets more of a pass because we used to have a lot of inline JS in the past. Doing it the other way was a lot sloppier before because HTML was such a chore to include in JS.