Live data from Hacker News

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

reviewbunny.app

441–450 of 490 posts

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

#441

Earlier quoted context omitted.

Yep, it's like every other MVC or server side framework. You can still send client side JS for interactivity, and these days there are small jquery-like micro frameworks like petite-vue, alpinejs, stimulus, etc. that are made to sprinkle in interactions where necessary. If you want the smooth SPA-like experience there are systems like hotwire or htmx which effectively hide all the page reloading.

That sounds like a terrible user experience.

You already are used to it. Lots of the web is rendered on server.

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

#442
post #228

Google searches for React and node.js exceed searches for Ruby on Rails by 100% and 50%, respectively [1]. Some people have used this to argue that React/node are more popular than Rails. But I wonder if perhaps this discrepancy appears in Google Trends because it takes more google searches to accomplish the same thing in React/node versus Rails. I feel the Rails ethos of "convention over configuration" allows me to…

As someone who came from other MVC frameworks outside of Ruby, learning Rails has been a cluster-f of searching through documentation circa 2013. The whole rails “convention over configuration makes it easier” is a load of bologna, because the only way to know the “convention” is to either have gone to a rails boot camp, reading the docs top to bottom, or maybe watching rails casts. The best way to work on rails is t…

There is a reason why most coding bootcamps are based on Rails and React instead of Go, Java, PHP, .Net etc - they are easy to learn, work and reason with.

> the only way to know the “convention” is to either have gone to a rails boot camp, reading the docs top to bottom, or maybe watching rails casts.

I mean, when learning a new language or framework, reading the docs or watching videos and tutorials are part of the course? What other MVC frameworks have you worked with where someone new could just go in and start building an app without actually learning it first?

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

#443
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 attitude was different; instead of big opinionated but inflexible frameworks, people wanted to pick and choose.

I enjoy working with Node and JS, but this IMO is what contributed to the fragmented node ecosystem where you have 100 different npm libraries that do the same thing and reinventing the wheel is rampant

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

#444
post #441

Earlier quoted context omitted.

That sounds like a terrible user experience.

You already are used to it. Lots of the web is rendered on server.

Sure, zero-js solutions are fine for marketing pages. But for an application you wouldn't want to wait for a page refresh when doing anything.

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

#446
post #228

Earlier quoted context omitted.

As someone who came from other MVC frameworks outside of Ruby, learning Rails has been a cluster-f of searching through documentation circa 2013. The whole rails “convention over configuration makes it easier” is a load of bologna, because the only way to know the “convention” is to either have gone to a rails boot camp, reading the docs top to bottom, or maybe watching rails casts. The best way to work on rails is t…

"Reading docs top to bottom" is the answer to this frustration. It's strange that people don't think this is something they should do.

Only if the docs were good enough! You always have to look at the source code for most Gems and it's full of unnecessary "magic". I guess Django is a much better alternative because of Python different school of thought

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

#447

What I've gathered, over the years, is that the people who dislike Rails because it makes a lot of decisions for them think they're just too cool for that. It insults their programming ability. OK, I can see that. So, go ahead; have it your way. But while you're still writing thousands of lines of boilerplate in both the front and back ends, and getting your types sorted out, I'm done with my app, and moving on to th…

Been working with Rails close to a decade now. I've built several, non-trivial products using Rails for the API, by myself. What I and my coworkers dislike about Rails is the sheer amount of magic. Oh and concerns, let's not forget that pattern. Rails is amazing at standing up a CRUD app (really API) in a matter of minutes. I can have a basic CRUD app with authentication, authorization, API, caching, background jobs,…

Making good architectural choices for complex problems/solutions is difficult with any framework or language though. What I like with rails is that it's easy to work on the easy parts, but it doesn't stop you to make more complex choices on the difficult parts.

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

#448
post #368

Earlier quoted context omitted.

You're being strangely combative in this thread, as though you are personally offended by something. What's your problem, and why are you letting it drive you to make such weak arguments? Do you have some past trauma related to being forced to read, or is it just bad experiences with Rails specifically? It really doesn't take more than a few seconds to figure out why your analogy of learning a language by reading a d…

You’re right, I apologize. You are right that my analogy is stupid on a bunch of different levels. I’ve been surrounded by so many rails fans who use it for every possible problem. “If all you have is a hammer, everything is a nail” was the epitome of what was happening. Then being left with trying to sift through old versions of documentation, trying to figure out what is the “current” way of doing things in rails v…

People who throw Rails at any problem, either have not maintained a Rails project for long enough or they don't know any other alternative tech.

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

#450

Rails and Ruby bake in a lot of really nice, ergonomic features for every day programming, not just larger architectural decisions. For instance I am working on a React Native app in my spare time and so much of Javascript seems tedious. Example is dealing with date ranges. Contrived example: import { isWithinInterval, subDays, addDays } from 'date-fns'; const today = new Date(); let range = { start: subDays(today, 1…

Use https://momentjs.com instead

    moment('2022-02-05').isBetween(moment().startOf('day').subtract(1, 'day'), moment().endOf('day'));

Still requires one import but that's hard to avoid. Don't be afraid of them, the IDE will usually add them automatically and hide them anyway. It's a good way to increase tracability maintainability, instead of magic stuff happening in the background.
Post reply on HN