News for hackers. Stuff that matters.
Re:React 16 by tomelders on Tuesday September 26, 2017 @12:47PM (#15340368)
This really boggles my mind. Having looked very closely at both (and being a react developer full time), I can not recognise this assessment. I just can't see how people can claim that Vue is simpler or easier than React.

React is idiomatic javascript. Vue is it's own quirky thing that doesn't feel anything at all like Javascript to me.

Re:React 16 by irrational on Tuesday September 26, 2017 @03:56PM (#15342009)
Different peoples brains work differently. React clicks with your brain, but not Vue. I've been doing web development since 1996. I read through both the React documentation and the Vue documentation. Vue just clicked with my brain. I totally groked it from the beginning. React... not so much. Vue has been amazing for us so far.
Re:React 16 by overcast on Tuesday September 26, 2017 @01:08PM (#15340567)
I'm not sure what feeling anything like JavaScript has to do with the discussion. No one asked which framework is most like JavaScript. I don't think JSX turning JavaScript into some weird XML/HTML hybrid feels like JavaScript either. Sure you can use it without it, but why would you? Vue works for me and others, whereas React works for you, and others. Let's just keep working on our projects.
Re:React 16 by tomelders on Tuesday September 26, 2017 @02:55PM (#15341542)
Because the rest of your application is Javascript. Less cognitive burden when you switch to working on different layers of your application.
Re:React 16 by irrational on Tuesday September 26, 2017 @03:58PM (#15342027)
Wait, do you really experience cognitive burden when switching between html, js, and css? It surprises me if you do.
Re:React 16 by tomelders on Tuesday September 26, 2017 @04:14PM (#15342133)
I'm talking about switching between a context where there are first class functions that can be easily passed around, to a context where there's some archaic and magical, non idiomatic convention based on string based dependency injection, or magical way of writing attributes.
Re:React 16 by overcast on Tuesday September 26, 2017 @03:37PM (#15341864)
Except JSX isn't JavaScript, and no one uses React without it. So it's arguably just as much of a cognitive burden.
Re:React 16 by Shywim on Tuesday September 26, 2017 @01:33PM (#15340827)
Depends what you call idiomatic. I dont think JSX is really a JavaScript idiom, more like a HTML idiom applied to JavaScript which happen to be often used together.*

At the end of the day, I think that calling something idiomatic is subjective and so, varies from people to people.

*: to be clear, my point is many people use JSX with React because it feels idiomatic (I manipulate HTML/DOM, so why not just write with HTML-like syntax?) but it is not idiomatic to JavaScript and I don't think the other React APIs are that nice to use. If I didn't use JSX with React, I'd tend to use other framework because, in my opinion, they make more sense.

Re:React 16 by l1ambda on Tuesday September 26, 2017 @01:35PM (#15340842)
JSX is optional.
Re:React 16 by bpicolo on Tuesday September 26, 2017 @02:40PM (#15341430)
It's optional, and also not optional. Nobody is using React without JSX in practice, because it's ugly and verbose.
Re:React 16 by l1ambda on Tuesday September 26, 2017 @05:58PM (#15342881)
Not true, without JSX, React is basically Mithril, if you alias React.createElement to a short function name.
Re:React 16 by bpicolo on Tuesday September 26, 2017 @06:09PM (#15342972)
Yeah, and I'm arguing that it's pretty ugly to write nested html that way.

Hater-or-lover of JSX, it is definitely an intuitive way to think about HTML in the context of JS.

I prefer the vue model that's a bit closer to the metal, though, if only because of quirks like className

Re:React 16 by l1ambda on Tuesday September 26, 2017 @06:22PM (#15343093)
Think I see what you are getting at--in practice most folks using React are going to use JSX and build tools, and if you alias the function it's kind of non-standard.

Mithril has "class" instead of "className"; that irks me too.

Re:React 16 by oceanswave on Tuesday September 26, 2017 @01:50PM (#15340985)
And vue optionally supports Jsx, so original comment or using it as a reason why ‘react sucks’ is being super pandentic. It’s ok to have multiple frameworks!
Re:React 16 by Touche on Tuesday September 26, 2017 @02:18PM (#15341251)
Optional features contribute to a tool's complexity, especially when every single example assumes you are using said optional feature.
Re:React 16 by cnp on Wednesday September 27, 2017 @01:43AM (#15345197)
And <Foo bar={'hi!'} /> is the same as Foo({ bar: 'hi!' })
Re:React 16 by twfarland on Tuesday September 26, 2017 @12:52PM (#15340413)
Agreed. Pure views are much simpler.
Re:React 16 by bpicolo on Tuesday September 26, 2017 @02:41PM (#15341439)
You can write prop-only, pure views in vue. :)
Re:React 16 by twfarland on Thursday September 28, 2017 @12:47PM (#15358651)
Ignorance revealed :) thanks. What's Vue's idiomatic approach for managing state at the top, outside of all components (like Redux)?
Re:React 16 by corford on Friday October 06, 2017 @04:26PM (#15420155)