5 ms·
I'm not a React hater (in fact, I like it a lot when it fits) but I think when people criticize React, they're actually after the one-size-fits-all attitude dis
by tannhaeuser 7y ago
I'm not a React hater (in fact, I like it a lot when it fits) but I think when people criticize React, they're actually after the one-size-fits-all attitude displayed in comments such as yours. No, React is clearly not "the only sane way of doing web development" considering the web hosts many types of markup applications, the most successful ones predating React by decades.
- crubier 7y agoOnly sane way, you missed a word. Of course there are other ways, but they clearly flawed in my opinion. I used to hate web development before 2014 and now I love it. Php is an awful language, jquery was a nightmare. Angular makes no sense hence why it keeps reinventing itself, Vue forces you to have some logic expressed using an ad hoc language in templates like it’s 2010 instead of just using JS constructs etc... I stand by my point, I am yet to find a use case where some form of react is not the best solution. Whether it is server side rendered, a single page app, or statically rendered. The only criticism I hear about react boil down to people complaining about bad practices that are not linked to react, but merely conflated with it, like not caring about bundle size, messing architecture or other aspects that are orthogonal.
- izietto 7y ago> Vue forces you to have some logic expressed using an ad hoc language in templates That's not true, you can use JSX with Vue, we do use that for one of our clients and it hasn't raised issues whatsoever
- crubier 7y agoYou are right indeed, but from a developer point of view at that point you could be using a react based framework and your experience would be the similar to vue with JSX. Render functions returning JSX is the key brilliant idea invented by react and the fact that vue adopted it just proves the point even more: React or the ideas at the core of react are not the mistake of the last decade but the blessing of the last decade for web development (and more).
- izietto 7y ago> from a developer point of view at that point you could be using a react based framework and your experience would be the similar to vue with JSX It will not, because Vue has a better integration with the data source (Vuex) and a better integration with the routing (Vue Router) I mean, I agree that React is an awesome framework implemented upon great design ideas (pure functions and plain JS templates), but it has its shortcomings, that frankly make me still prefer Vue to React (mainly Redux and the router)
- crubier 7y agoFor routing react-router is just perfect. And for data source/state management there is plenty of choice, I use Apollo for global state/data source and useState for small state full interactions, I can’t see how it could get simpler. But whatever floats you boat really, the point is that the nice part of vue are inspired by react anyway. I wish the two community merged, to be honest, I see no point in dividing for such small differences.
- spaceribs 7y ago> But whatever floats you boat really You specifically argued against that, your arguments seem to be highly religious in nature. I don't know how many years you've worked in the industry but if you think React will be the dominant way of building apps for the next ten years, I have some Adobe Flash developers who I'm sure would like to say a few words.
- orange8 7y agohaha! Former hotshot Flash ActionScript 3 Ninja Developer reporting for duty as requested. Seriously though, JSX and TypeScript are nothing new. Both were part of ActionScript 3, a big language backed by a powerful company (Adobe). 15 years later, nobody even remembers it existed. How am I still making a comfortable living coding today? By not getting too attached to any language or framework... they are all just tools in the end. So let the young ones be, time will eventually teach them those lessons, sooner than they think.
- rawoke083600 7y agoI don't want a "you could..." in my framework... I want a "this is the way" in my framework. Thus me the dev before me... the dev after me can get on with things. It will not be the perfect solution but it will be a consistent solution... This is of course true for any framework.
- goatlover 7y ago> Whether it is server side rendered, a single page app, or statically rendered. Nail meet hammer. Seriously though, what why you need a JS framework for static pages? What if your backend is in Go? What if you're doing heavy duty numerical analysis? What if your users want a Wordpress-like site? What if your team uses Rails or Drupal to quickly build sites? You're saying React is better at everything?
- DonHopkins 7y agoOff topic: I've always meant to ask you: Is your name a Blade Runner reference, or are you a user something called "Tannhae"? ;) https://en.wikipedia.org/wiki/Tears_in_rain_monologue#Tannh%C3%A4user_Gate https://en.wikipedia.org/wiki/Tears_in_rain_monologue#Tannh%... https://en.wiktionary.org/wiki/%E6%8E%A2%E6%B5%B7 https://en.wiktionary.org/wiki/%E6%8E%A2%E6%B5%B7
- tannhaeuser 7y agoDon't interpret too much into it :) When I signed up to HN and had to choose a nick, I sat in my living room looking at a Tanne (a fir in German) outside, and chose Tannhäuser (literally, a man who lives in the woods) in a hurry. If anything, it's a (quite arrogant towards the HN crowd) reference to Richard Wagner's opera/character rather than Blade Runner. Hopefully you're not disappointed :)
- DonHopkins 7y agoTannhäuser Gate is only the most enigmatic reference of the best scene of the best movie in the universe, and I never heard of any mind altering substance called Tannhae that you were admitting to use (are you a Can-D user or a Chew-Z user? [1]), so I assumed it must be a Blade Runner reference! But now I understand it's a direct reference to what Roy Batty may have been indirectly and allegorically referencing, which is quite un-disappointing. ;) [1] https://en.wikipedia.org/wiki/The_Three_Stigmata_of_Palmer_Eldritch https://en.wikipedia.org/wiki/The_Three_Stigmata_of_Palmer_E...
- ofrzeta 7y agoTannhäuser is also a opera by Richard Wagner (which refers to some older folk tale): This is probably what Philip K. Dick inspired to use that name.
- jbergens 7y agoI personally think React scales well both up and down but you can avoid Redux for small things. Use Mobx or some easier state management lib and you are all set.
- Cthulhu_ 7y agoBetter yet, avoid it entirely and stick to using React's Context (https://reactjs.org/docs/context.html https://reactjs.org/docs/context.html) or if you have to, useReducer() (https://reactjs.org/docs/hooks-reference.html#usereducer https://reactjs.org/docs/hooks-reference.html#usereducer). Of course, those are lightweight / 'native' (to react) alternatives to redux / state management; last time I used it there were some really neat (theoretical) advantages, such as a browser addon where you could do time traveling debugging (replay individual events) or push the state and all state changes into a support ticket for reproducibility. Purely theoretical though, and at the time using Redux added a lot of mental and labor overhead, especially when using it to manage forms. (personally, I think form data should never be part of a global state; it should be limited to a component that manages the data itself and does not leak it elsewhere. But, it depends on the situation, as always)
- lukevp 7y agoI think a blend of both is the best approach for most apps. Redux for global state, api interactions, etc. so that you get the power of middleware like thunk and saga and get great debugging support for overall app state, then anything local to a page or component (like you said, for form data) you use a react context and useContext it in child components to hook up events and manage page level state using useReducer or useState within your page component. This model has been very successful for us and helps partition state in an easy to understand way.