8 ms·
I'll be completely honest. I was anti-react when it initially (this is pre-create-react-app generator) came out and I'll tell you why. I tried to learn it and
by BukhariH 10y ago
I'll be completely honest. I was anti-react when it initially (this is pre-create-react-app generator) came out and I'll tell you why.
I tried to learn it and struggled understanding the new concepts react was bringing in all while people were saying "It's easy! Everything's a components. HTML,CSS,JS all in one place!" whilst I was struggling to get a simple hello world example to run.
Just recently at my University we were forced to learn React as a part of our course and damn after I finally understood it I fell in love! It's a huge improvement over the normal web-app design work flow.
So, I would urge anyone whose anti-react to honestly give it a good go and force yourself a little to get over the initial learning curve and trust me you'll love it!
- kraftman 10y agoAny tips for getting over the first hump?
- jdironman 10y agoBe forced to learn it evidently.
- Hnus 10y agoI could write a long list of things you should probably do but if I could recommend just one thing it would be to watch this video https://www.youtube.com/watch?v=xsKYAa1ZXpQ https://www.youtube.com/watch?v=xsKYAa1ZXpQ it really helped me to understand how react works.
- supergreg 10y agoThink of it as a way to create your own complex HTML controls like the combobox/select. And just like those, try to give all information it needs to work via attributes or sub-elements.
- ergo14 10y agoIf you like component approach, take a look at Polymer, I'm right now working with react, and while it is OK, I've found that web standards based approache to components is better. And web components can be used in react or other solutions nicely. Being "anti-react" doesn't mean anti-component approach. You can do same with angular 1.5+, vue, aurelia or others.
- jondubois 10y agoThat's a good point. I don't think many people actually dislike React. There are people like me who might be mildly frustrated that React is getting so much attention when Vue.js and Polymer might be better, simpler solutions. I like React (especially with all the new setup and debugging tooling) but whenever I use it, I feel that it is a small step down from Polymer. I think that unfortunately Polymer 0.5 was launched too early and its reputation has been tainted even though Polymer 2.0 is amazing. I do know that there are also developers in the Vue.js camp who would never use React out of principle. I spoke with HR people from Facebook in the past and they've told me that there are developers who simply refuse to use React but I think it's more a matter of stubbornness because, all things considered, it is roughly comparable to Polymer and Vue.js.
- nojvek 10y agoIs polymer really a Web standard? Seems like something Google is pushing down. The implementation is quite fragmented. I'd love browser makers to focus on the basics like rendering, js and asm.js and leave the rest to libs.
- ergo14 10y agoNo - Polymer is not a web standard - Web components are (https://www.webcomponents.org/specs https://www.webcomponents.org/specs) - and are implemented as a standard (its not fragmented all vendors agreed on v1.0, chrome, safari, opera already ship with them, MS and FX are close to follow) - polymer is just 30kb on top of that to make your life easier. This is exactly what you described with asm.js. It just happens that out of all libraries that help you create web components, polymer is probably most widely used - well, angular 2.x can technically output web components too, but I don't want to compare a framework with library. But you can mix those components with other solutions (like x-tags, skatejs, bosonic, "pure components" etc.), they are interoperable, I even have them cooperate with legacy jquery application.
- justsee 10y agoIn the context of Next.js's serverside-rendering approach, Polymer has an open ticket about providing support for SSR: https://github.com/Polymer/polymer/issues/3955 https://github.com/Polymer/polymer/issues/3955.
- morley 10y agoIn my experience, a LOT of developers learn that React is a good framework because (a) it's component-based, and (b) the virtual DOM. So my guess is that a lot of developers hear the lines "React is the V in MVC, it has components, it has virtual DOM," and since those words don't really mean anything, they just dismiss it right away. In my personal opinion, these reasons are superficial: the reason to use React is that programming UIs declaratively is easier to reason about than imperative UIs. That point can be subtle. It helps to have worked on (and struggled with) an imperatively-programmed UI before you can see how much of a pain it is. And it didn't help that out of the gate, React was pitched with "components" and "virtual DOM," and it took a while for even Facebook to be able to communicate what was so compelling about it.
- laughingman2 10y agoI have writtern imperative UI in iOS, jQuery with server templates. I love react for its declarative UI, but when people ask how it differs from angular 2 or ember, I don't have an answer. I tried angular 1 ages ago, and left it. Any concise answer on how react's declarative UI differs from a 2 way binding approach in angular (or if they have changed it that)?
- dlwj 10y agoSame, the people who are crazy about react are often the people who never understood MVC originally, writing terrible apps in older frameworks like Backbone with jquery code shoved into the render() function and the model event system used as a global pub-sub for everything. React's virtual DOM is a hands off implementation detail that forces understanding of MVC. People can't asks= "How do I put the thing in the place", b/c that's automated by the virtual DOM. Instead, they are forced to understand that they need to describe the end state. Which is something that even an older framework like Backbone tried to do, with the end state being you only having to care about your models with the rendering automated. Progression of (frontend) MVC started with Backbone, with manually wiring up models and view render functions so that the model changes could drive the UI. It's a specific implementation of pub/sub with the published events being a certain set of model changes. (add/change/delete/...) (Redux is pub/sub with a security guard logging your actions and only giving you specific vetted actions to combine. Also, functional goodness.) Angular 1 went with a polling approach that negated much of the boilerplate in backbone but was not performant (and bad docs, new things to learn, etc..) but also showed many people a cleaner paradigm of writing UI code. The trap with angular was putting everything in the controller just like the trap with backbone was putting everything in the render function. React uses a virtual DOM so the thing to render doesn't need developer input. It's automatically inferred from the DOM diffs so the developer can focus purely on describing the UI. This is the forcing function that forces people to put down jquery and actually learn MVC. Once this is understood, you can get into managing more complex models that actually mutually affect each other that may necessitate something like Redux. (Also, somewhere along the way, OOP become unpopular and functional stuff became hip) JSX btw, is just an extension of javascript to create DOM elements in a less ugly way. Angular and Vue went from the other direction and extended HTML to support javascript functions. It's "<div v-for="a in apples">{{a}}</div>" vs apples.map(() => <div>red apple</div>)" It's personal preference in many ways. (You'd actually need to know a fair bit of functional js though to write concise non-ugly JSX that doesn't bury the meaning of your UI description) The main issue I have with react is that it seems much more like a lifestyle than a tool that gets out of the way. When people list out their reasons for liking react I'm mostly just hearing "because facebook, facebook, cool, cool, facebook" just like angular was driven by google before the angular 2 marketing fiasco. And there IS truth in it. The background philosophy driving React is actually a philosophy of functional programming which has real merit. In the real world though, with many people knowing only how to use jquery, React may help you explain to them how to understand MVC, but you're going to have a much more difficult time shoving the functional lifestyle that comes with it down their throat. But hey, if you're in the facebook sphere of influence or want to be a part of it, go for React. (Also, if you're a new grad who doesn't have the baggage of jquery) Paradigm shifts often take a much longer time horizon than expected and often require an "earthquake" for newcomers to upset the established ideas. React and Typescript were in background mode for quite a while. The non-backwards compatibility of angular2 drove people to React, and I think Java programmers getting into web development and Satya Nadella being cooler than Balmer gave typescript a good boost. In the end though, I don't really want to be comparing hundreds of different hammers to build my house. I just want to build a house. And hey, hopefully I have more skills than being a builder so that when entire houses are 3D printed I can still find a way to justify my existence.
- nkg 10y agoAlso, don't dive in with Redux at first. A Redux-like tool is useful, almost vital to a web app built with React, but I had to build an app without state management to understand why I should have had used it.