5 ms·
I really don't get the love around vue... I always read the glowing sentiment and go, "Ok, I'm missing something, let me go back to the vue.js docs and see what
by lsdafjklsd 9y ago
I really don't get the love around vue... I always read the glowing sentiment and go, "Ok, I'm missing something, let me go back to the vue.js docs and see what's good"
Things that are a deal breaker for me:
Template language... You can call it 'separation of concerns' all you want, but just let me generate templates using the language I already know, JSX is great
State management... I cut my teeth with Ember professionally for a few years, and really loved it up until I built a data intensive app. Having state spread across different controllers is great when you have many different routes and pages, but if one page turns in to a photoshop like app, controllers make a terrible state management tool. It doesn't seem overly complicated to me to use redux along with react-redux's connect function to connect regular functions returning JSX to your state object. Looking at Vue.js, it seems like I need to learn Ember-lite + Angular (custom directives).
- kevmo314 9y agoAre you sure you read the right docs? > let me generate templates using the language I already know, JSX is great https://vuejs.org/v2/guide/render-function.html#JSX https://vuejs.org/v2/guide/render-function.html#JSX > controllers make a terrible state management tool. I haven't used react-redux but vuex is essentially the same decoupling, and there's very little boilerplate. https://vuex.vuejs.org/en/intro.html https://vuex.vuejs.org/en/intro.html
- nawitus 9y ago"Template language... You can call it 'separation of concerns' all you want, but just let me generate templates using the language I already know, JSX is great" Not everyone knows JSX, so while that argument applies to you, it doesn't apply in general.
- jonreem 9y agoThey mean javascript; jsx is a very small amount of new syntax and is embedded in normal javascript. Learning a completely separate template language with all of its own constructs for conditionals, iteration, etc. is significantly more work.
- bpicolo 9y agoThere’s not any more to learn vs html than jsx. It’s like 5 relevant constructs that all follow the same form, and the colon. Takes 20 minutes to have it down pat. v-if is actually a big reason I prefer Vue. Ternary operators in JSX are pretty ugly. The other is that Vuex just feels so perfectly integrated. I've never felt Redux blends in particularly cleanly, though I certainly don't judge people that do prefer it.
- rmrfrmrf 9y agoIf `do { }` syntax makes it into ES9, the whole ternary-operator-hate business will be a moot point
- bpicolo 9y agoThat's alright. I love and appreciate React too, I just prefer Vue now.
- dmitriid 9y agoTernary operators in JSX are valid javascript expressions. As is anything that goes into {} All of the following is neither Javascript nor HTML: v-for=”x in list” v-if=”conditional” v-on:click=“function” v-bind:key=“something.id” etc. etc. etc.
- bpicolo 9y agoI'm aware of that bit, I just think they're an ugly piece of control flow inside JSX, and they're also not a particularly versatile piece of control flow. Especially for the else-if case - you end up with repetitive conditionals to replicate that.
- Aeolun 9y ago> and is embedded in normal javascript Exactly! I don't know, but I've always found that disgusting. It turned me off React when I first saw it, and it still does. Then people use it to defend react, and I'm just like 'Lolwut? Did we spend years learning that SOC is a good thing only to throw it out of the window?' I'll be the first to admit that any Vue template quickly becomes soup as well, but at least it's only half of the soup. Is it just younger developers that think React is the best thing since sliced bread?
- philliphaydon 9y agoI can’t stand Jsx personally. Vue files with the entire component defined in 1 place and writing HTML templates... preferred for me.