4 ms·
I keep reiterating this point, but people keep calling React complex, it's not. React is raw simplicity. As far as I'm aware it's the most minimal API for creat
by lopatin 9y ago
I keep reiterating this point, but people keep calling React complex, it's not. React is raw simplicity. As far as I'm aware it's the most minimal API for creating sufficiently complex UIs. It's so minimal that it's hard to build full apps in because it says "not my problem" to questions such as routing, global state management, you name it. And that's fair. I still maintain that it's a tool for pros. But the responsibility that it does take on, I believe it does so in the most simple way possible. And you don't need to be aware of React internals to use it effectively. The details of the component lifecycle are not internals, but part of the public API.
- look_lookatme 9y agoIt's easy to say React is simple if you are looking at, say, a barebones create-react-app. But most production React apps I have worked on (I work at an consultancy) seem to accrete complexity faster than functionality. I used to chalk this up to me not "getting it". Now I think it has more to do with the desire to incorporate newness into React apps. Stuff like ripping out routers to replace with another router but then the old router was rewritten so lets replace it with that one again. That kind of stuff happens, and even it is preferable to someone deciding to incorporate something like [shudder] styled-components half way through a project. This kind of stuff almost always incorporates new abstractions that will increase surface complexity. In the interest of avoiding a rant, I won't start with people monkeying with context or not understanding the effects of setState. React should be judged by the quality of it's ecosystem and extant production code, and I would argue that if you survey these things often you will find plenty of unnecessary complexity.
- cloverich 9y agoI have to agree w/ lopatin overall: React is a tool for professionals. And I think it addresses your arguments very well. Being open source and powerful, its reached for by people left and right who do not (yet) understand how to architect well constructed applications. And the results are predictable: Needless complexity, bloated apps, bad ui. Personally, I don't read any more into it than that.
- vectorpush 9y agoIf you're rebuilding aspects of your production system for the sake of "incorporating newness" then the problem is poor engineering not react or any other tool. If things are working fine as they are, you only have yourself to blame when you introduce new technology that you find too complex to manage.
- kostarelo 9y agoIts the overall ecosystem that makes it complex. You can use it as is but everyone is using webpack and babel, so you have to use it too. But once you are into those tools (and all the others that they come with) then it becomes too complex.
- lopatin 9y ago> You can use it as is but everyone is using webpack and babel, so you have to use it too. No you don't. You can absolutely use your own build system, or no build system, and still make use of open source components and libraries from the React ecosystem.
- pbreit 9y agoSo which is it: "not complex" or "hard to build full apps"?
- lopatin 9y agoIt's like LEGO's. The blocks are sturdy and the rules of how blocks fit together are simple. But building a mini Taj Mahal is still not easy. You do have to know basic physics & structural engineering, but if you do, the task is very do-able. Even fun. Unlike if you were building a mini Taj Mahal out of match sticks, Elmer's glue, rope, and playing cards. Even a professional structural engineer would have a hard time with that. The rules of gluing a match stick and a playing card together are already complex (not to mention uncertainty about where to rope fits in), and it that makes it that much harder to make a final product. This video goes into "simple" vs. "easy" https://www.infoq.com/presentations/Simple-Made-Easy https://www.infoq.com/presentations/Simple-Made-Easy
- daliwali 9y agoConsider facts: React is over 40k lines of code, there are 30+ classes/methods to be aware of though maybe 10 of them are commonly used. Would you call it "minimal"? There is still a lot more that could be done with a smaller API surface and much less code. Compared to Angular, it might as well be a micro-framework, but by objective measures it's not so simple.