4 ms·
Those are two separate questions really. React is another in a long line of Backbone, Angular, Durandal, etc. that ultimately just make stuff a lot more compli
by mattmanser 10y ago
Those are two separate questions really.
React is another in a long line of Backbone, Angular, Durandal, etc. that ultimately just make stuff a lot more complicated for fairly trivial benefits. It dictates fairly complicated ways of doing simple things with long complicated tool chains that regularly break for obscure reasons that you can debug but ultimately it feels like you're simply wasting your life dealing with it. It's easy for juniors to make ridiculously complicated messes in them. They remind me of the good old days of RAD dev tools. "Oh so easy" they claimed.
And if you're any good, you can enhance traditional web forms and add the same sort of functionality without all the overhead, or complexity. Perhaps I simply have the benefit of over a decade of front-end dev.
As for SPAs, they still live firmly in the uncanny valley. They're poor versions of desktop apps, even desktop apps from the 1990s. Anyone claiming otherwise is simply delusional. Because of javascript and the DOM, they also tend to complexity, so that anything past a glorified to-do app becomes an absolute nightmare to code in.
I use Trello, Asana, Toggl, SendWithUs, etc., etc. They're all, well, a bit shit. All of them have really annoying niggles, fields you click and then might auto-save but might not. Poor desktop interfaces because "mobile first". Tabbing that doesn't work properly. Data that gets out of sync. Or they're sllllooooowwwwwwwwwww.
As for the reason React became so popular? This happened before with terrible frameworks. I may be a cynic, but it feels front end devs have got into some sort of mega-echo chamber where a new framework comes along and everyone jumps on to it because they don't want to seem out-of-date. The front-end world feels like it's in a strange kind of culture at the moment, a type of Emperor's New Clothes, where if you're not using The Latest Framework, you're obviously not worth employing.
Not because it makes you get a product to market quicker. It's a new form of bike shedding.
- lobster_johnson 10y agoAs someone who works a lot with React — and have previously worked with things like Rails and Backbone — I adamantly disagree that the benefits are trivial or that it's more complicated. The functional component architecture makes it considerably easier to create less buggy UIs with less messy codebases. You sound like you don't really know or understand React. Which is fine, but it doesn't put you in a good position to criticize it intelligently. React isn't popular because of any kind of echo chamber phenomenon. It's popular because of its design; it managed hit a particular very sweet spot combining the various principles of composition, modularity, functional purity and internally consistent state management. I do agree that web apps aren't as good as desktop apps. But that's not the fault of SPAs.
- SnowingXIV 10y agoI feel I'm in the same camp as the comment you're responding to, so I do want to chime in. Most of the applications I've had to develop require a database of some sort, rails makes this incredibly easy to do. I can simply generate a model and migrate. There are very few applications (that I've needed to develop) that don't require a reliable database. This is where I've yet been able to truly utilize anything like react, vue, etc. The best situations been some form storing json data objects but that's not scalable and I rather be able to backup a sql database to query from (especially with thousands of records). And I know facebook uses it and has one the biggest databases on the planet but I'm talking about easy of use in spinning up full stack applications as a small shop and understand what's going on. I know you can use react on top of rails (with postgres, mysql, etc), but then I start feeling too many weird abstractions going on and have a hard time following the bouncing ball. React claims to be just the V part of MVC which is fine, but when I'm trying to quickly build up a full stack application rails just felt the simplest way to do so. Bringing this up not because I think there is anything wrong with React and I know they are solving a pure front end problem, but this is more of a question to what's the most elegant full stack solution that would be comparable to RoR solution with any of these new hot js frameworks? If there is I think I'd be more than happy to startup some projects that way.
- lobster_johnson 10y agoEasy: Write your backend as an API, and let the UI be a thin client that talks to it. You can write your backend in Rails (or Sinatra, which we've used a lot) and use the same workflows to wire up models and so forth. I wouldn't want to write database stuff in JavaScript. The frameworks are all terrible. Nobody has managed to replicate the ActiveRecord story for Node.js. Except for legacy stuff (which use Ruby + Sinatra), we write our backends in Go. But that might not be your cup of tea.
- mattmanser 10y agoWe must just make different types of apps. I work on a couple of startups at the moment, one of which that has an admin interface in a SPA, one doesn't. I can throw in new reports, functionality, etc. in the non-SPA one with less than 1/2 day's worth of work, sometimes even in minutes. The SPA one takes days to do similar functionality. It's just all so bloody complicated getting it working together. Make a new end point, create a new DTO, make sure you're not leaking anything from the end-point, duplicate validation logic, wire up view models, have it not work completely for an hour or two of debugging because you forget to add one line to some gulp file or something equally ridiculous. And then you throw in something like React and they want you to do it X way with Y thinking and Z plugin doesn't like you're returning the wrong content type or data structure or something but doesn't throw an error about it, logs it as some sort of warning, or if there is an error it's deep in the guts of 10 nested 1 line self-referential call in the library. It just adds so many moving parts, functionality ends up sprawled over 10 different files, it's hard to grok or reason about, hard to know if you've done everything you need to. I find it simply unpleasant to work in that way. I just want to write the UI and the logic and be gone, not dealing with frameworks barfing out bizarre warnings or mysteriously broken builds. Actually, nothing fills me with more dread in a SPA than when I click a button or something and nothing happens. The worst problem programming in SPAs is when things simply just don't work and there's no error at all because you didn't quite invoke the magic framework in quite the correct way. Yay SPAs.