Live data from Hacker News

Don't make me think, or why I switched to Rails from JavaScript SPAs

reviewbunny.app

81–90 of 490 posts

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#81
In a strange way the adoption of JS SPA's has made the "thinking-not-required" backend frameworks like Rails and Django less "opinionated" and thus requiring more thinking.

I don't know about the Ruby/Rails ecosystem but in Django there are now quite a few different ways to deliver the "same" user functionality depending on how much one splits the load between front / backend, whether and how much it is structured around DRF etc.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#82
post #62
post #40

This article resonated with me, but the main reason I moved from RoR apps to JS/SPA was hosting costs and scalability. I can build a SPA and host the bulk of it on Amazon S3 and pay significantly less monthly costs AND have scalability built in. If you've figured out a way to do something remotely similar with Rails, I'd be back in a heartbeat.

I think you meant to say that you can build the front end of an RoR app in JS/SPA and host it on S3. Because it is hard for me to see how you can create a backend API in JS and host it on S3. I might be wrong as my knowledge in JS is limited.

Right, front end on S3 built in something like React, and API/backend on other services. There are established patterns like https://docs.aws.amazon.com/prescriptive-guidance/latest/pat... and https://docs.aws.amazon.com/whitepapers/latest/serverless-mu..., but looking at the diagrams supports OP's point: "it so much harder to create apps in the JavaScript ecosystem."

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#83
post #67

Earlier quoted context omitted.

Sure. And I think what makes Rails and Django shine is they have sound default answers. I’ve yet to see anything in Node that feels like a stable 1:1 replacement. Next.js is excellent, but you still need to sort out a lot of pieces on your own.

I'm working on two inherited Django web apps right now, for the same customer. I wish Django has a default project structure like Rails. It doesn't. The only common ground between the two apps is that they are written in Python, use the same ORM and templating engine. One is a spaghetti monster of a zillion of apps that depend on each other (so the separation in apps is useless) and the database is totally opaque to…

That's not accurate. Djano encourages, but does not mandate, a particular structure. Incompetent developers will always find a way to subvert whatever sensible defaults are at hand, which is the case you are faced with.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#86
I enjoy building SPAs, but I often wonder if my joy comes from having built something, or is it just seeing the little virtual ball make it's way to the end of the overly-complex Rube Goldberg-like contraption of cloud services, NPM packages, bundlers and frameworks my product is built upon.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#88

Am I the only one who simply looks at the business requirements when considering an SPA? Ive built music players, games, real-time chat apps, etc that would be very difficult or impossible with a server side rendering app.

Is SPA just another way of saying "WebSockets"? I've added minimal websocket-based real-time features to what are otherwise simple serverside web apps, for example a terminal emulator. Don't need to go full SPA.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#89

Earlier quoted context omitted.

I can't help but think it is a reflection of the JS ecosystem that I assumed you had misspelled Next.js

I guess Nest.js is actually right: https://nestjs.com/ A TypeScript framework like Rails is a framework for Ruby.

I'm lolling because their first code block next to a live preview shows "500 internal server error"

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#90

I think the author went too deep into details here, as this crowd is full of people who are going to be able to rip pieces of this article to shreds. But doing so both misses the larger point and in the process proves it - Rails gave them a set of answers that are good enough so they don't need to delve deeper and can just focus on their app. Rails is not the only choice that does so. And people with broader skill se…

The issue I have with the JS world is that the most used libraries and frameworks are just "good enough for a small project" and no more than that. * Javascript has such a minimal standard library, you will need to get one or three third-party libraries to augment its core. * React is an excellent view library and nothing more. You will need to get one or three third-party system to turn it into a fully fledged web f…

Agree with everything, but saying Next.js is just enough to create a static page is quite the strech.
Post reply on HN