4 ms·
Oh please. React itself might not be that difficult but thrown in couple overly engineered libraries like react-router and immutable.js and that poor beginner w
by tekkk 9y ago
Oh please. React itself might not be that difficult but thrown in couple overly engineered libraries like react-router and immutable.js and that poor beginner will start feeling a bulging Javascript fatigue in their foreheads.
Once you get rolling both of them are good but it's no easy task to start-up a React project on your own. You need a lot libraries, have to twiddle with immutability which is no piece of cake with JS and be constantly aware of small quirks like keys when looping jsx-elements, className instead of class, how to add css preprocessor, using setState instead of directly assigning to it with the constant farce with deeply nested Object.assigning oh such fun.
React tries to make the world a better place with more theoretical approach while Vue focuses on tried-and-true methods that work and are straight-forward for everyone with a little experience in programming. (v-if might not be pretty but it beats JSX conditional) Granted modern frontend development has a lot of different things to be aware of that make it bit difficult for beginners but IMO Vue makes it a lot more simpler and productive. Some things I wish might be better like the ecosystem but oh well. Overall I'm happier and the only problem is having to fight off overly smug React-developers who have rubbed their egos so hard that they aren't able to even think about better solutions anymore.
- mlsarecmg 9y agoimmutable.js for what? Seems to me you're picking up hear-say here and there but why and for what would you want to use immutable. Even redux docs speak out against it. It's just a random tool like any other, you're assuming it has some deeper significance with react, it doesn't. > be constantly aware of small quirks like keys when looping There are no "quirks" in looping anything. It is plain javascript. I would call "v-for" a quirk on the other hand. const array = [] for (let item of items) array.push(<li>{item.text}</li>) render ( <ul> {array} </ul> ) Recreate the snippet above, then let's discuss.
- mikewhy 9y agoDoesn't that produce the "array items should have key prop" message? Also you can use `items.map` in your example.
- mlsarecmg 9y agoI only wanted to show that react doesn't specify a programming style. He said javascript maps are "quirky." Maps are fine but so are plain loops. Ternaries are fine, so are plain if-then-else constructs if someone would like it better that way. The example would run without keys, it's merely for demonstration. You'd need keys in Vue as well.