Live data from Hacker News

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

reviewbunny.app

61–70 of 490 posts

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

#61
read quite some articles like switching from SPAs to rails|django|laravel, basically from the new cool kid back to the old man in the backyard.

but, what about using Go with its web frameworks(e.g. Gin), it has everything you need to build a web application, and it could be all in one binary, and if you want to scale it's not hard too.

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

#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.

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

#63
post #38

Earlier quoted context omitted.

PHP hasn't been madness for a long time. One could argue Laravel (a RoR inspired framework) has become better than RoR.

as a former Rails user now Laravel user, I would agree with this. PHP has mage huge strides in typing too, I havent kept up with Ruby to know if they do the same

No - typing is still basically a complete after-thought in Rails.

Sorbet is trying, but it's... not there yet (although getting better).

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

#65

I don't understand the comparisons presented in the article. Comparing a full stack MVC framework to a front end library is as apples to oranges as it gets. IMHO frameworks such as NestJS and Adonis are more comparable to Ruby on Rails.

I think you don't want to support the article's claims, but you kind of support it by mentionning the choice that you need to make between NestJS and Adonis or any other frameworks. With the ruby ecosystem, there is almost always a clear convention on what to do (example: the conventional choice is to use rails, which leads to a bunch of pre-made choices)

So long as that is in fact the point of the article, I agree completely. However I'd still have to point out that comparing the Rails framework to solutions which do not try to fill the same role such as React made for a confusing article.

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

#66
post #4

I used to write Rails professionally for many years This comparison isn't a good one. Rails is an all-encompasing framework. If you compare Rails to something like Nest.js, there's not much you're missing. Nest is one of the best application frameworks I've used in any language, and it comes with all this stuff you say JS doesn't have. --- EDIT: To clarify (because it is confusingly named), NestJS is a framework mode…

I think the main Thing here is that Rails is the de facto standard, the 'golden hammer' of Ruby based apps, and there is no space - or developers - for alternatives. The JS ecosystem as we know it today started years after Rails (Rails was 2004, Node's oldest version on their releases page is from 2011), and only really took off after NodeJS came to prominence with frameworks like BackboneJS, Angular, then React and…

The dominance of Rails for its use case within the field of Ruby is is only one half of the equation. The other half is that Ruby has mostly collapsed into Rails, there's not much Ruby happening outside of Rails. This could never happen with a js framework of similarly scope, because all the other js use cases won't go away. One example of such a thing that won't go away is doing client-side stuff in the scope of a Rails protect. JS would have to lose a lot before it could achieve similar focus.

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

#67

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…

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 inspection. The other app luckily tucked nearly everything inside a single app so its saner to navigate and we can query the database with SQL tools.

The point is that Django lacks a sane default for project structure and it costs time/money to people using it.

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

#68
I've settled with Svelte (SvelteKit and Sapper), after having spent lots of time with React and Vue.

Svelte works in a way that jives with how I think and work, and I've built enough components for myself that side projects now only take hours to design and build into working prototypes.

I think everyone needs to have a "home platform" where it's just mindless to get started. Regardless whether it's JS SPAs or Rails or raw HTML!

For handling data, it's either Supabase or Airtable's API, hands down. Tailwind for design system.

I've tried Rails before, but as a newbie to Ruby, I couldn't even figure out how to write for loops. To me, that was too foreign, and too much thinking involved. And with Rails, you need to run a server too right? That's even more not-mentioned work.

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

#69

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 framework.

* Frameworks like Next.js are good enough to create a static page, but as requirements grow more complex, its limited feature-set and lack of in-depth documentation will feel like a prison.

* Dev tooling is non existent, so it's on you to get and _configure_ a linter, type checker, testing framework, bundler, etc.

Without speaking of the DOM and CSS, which are just _now_ starting to feel feature complete for most use cases.

Javascript proponents say the ability to mix and match is its strongest feature, but to me the analysis paralysis of having to stop and shop for a library that does X (and will only do X) is a total productivity killer.

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

#70

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.

RedwoodJS may be something you want to check out. https://redwoodjs.com/

Yes, RedwoodJS seems like Rails for JavaScript.

Recently I’ve also been impressed with Remix that was mentioned in the article. It seems to have solved the client server code duplication problem while still offering the benefits of both.

Post reply on HN