Live data from Hacker News

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

reviewbunny.app

431–440 of 490 posts

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

#431

Earlier quoted context omitted.

> This is a ludicrous approach for most. there are about 35 guides in the rails guide list and half of those are digging deep into the framework... reading the first 10 of them would get you about 95% of what you really need to know in rails so that you can look up stuff later. hell even just doing the getting started guide walks you through a fairly complete rails application. https://guides.rubyonrails.org/

yah, that's what i did when i first got into rails (~3.0/3.1): read 5-10 of the guides while working through michael hartl's tutorial and reading/watching a number of railscasts (which are dated now, but still have good basic info). i'm working (slowly) on a personal project in rails 7 using all the hotwire with importmaps newness, and so far, it's been so much better than recent rails' diversion into all that node/y…

I just put all the essential ones through firefox reader mode and the high end of reading them at what is what an average reader can read at based on the word count and it puts it at 10.31 hours of reading. that's a basically complete understanding of rails that most people don't have. to get 80% there you could probably skim most of them and read the main articles on models, views, and controllers and be done in a few hours. (firefox uses a somewhat naive approach though that just counts words and can't distinguish new code vs. the interesting bits so i'd wager the time is less since there is a lot of repetition in code)

it's not a ton of investment compared to how much time it would save you if you use rails later.

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

#432

Earlier quoted context omitted.

Python is plenty popular and so is C#, and when you're looking at a batteries included full stack framework you have ONE popular choices - Django or .NET. For PHP it's Laravel (sure, you have other options like Symfony but they are niche), for Elixir its Phoenix. How is it a good thing for Node to have 5-10 competing frameworks that have similar adoption?

> How is it a good thing for Node to have 5-10 competing frameworks that have similar adoption? How is it a bad thing? Again, JavaScript is far more popular than all of those for web related development. The issue is that like you're stating, there isn't a single main option perse. I'd use NestJS.

I think its generally bad, or at least I wouldn't want no part of it. There's decision fatigue for one - how the hell do you decide what to use. Another problem is why would I want to relearn a new framework every time I switched companies? And how do I know these frameworks are going to survive long term in such a chaotic community? I have little doubts Django or Rails will be here in 10 years, can you be confident all these JS frameworks will still be here? Some will and some will probably become irrelevant.

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

#433

Earlier quoted context omitted.

There are a lot of solutions out there where you can share your datatypes between the client and server now though, and it's great!

This comment would be more helpful with some examples. I’m personally very curious what the leading solutions are. I’ve worked with one involving GraphQL but that’s about it.

Yep, I personally have written our backend in Python (with type-hints) and the frontend is a React SPA that I recently migrated from JS to TS.

After the migration to TS, I really want something I can use to model the data once and use in both the backend and frontend, because its very repetitive. Haven't found anything yet.

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

#434

Earlier quoted context omitted.

Python is plenty popular and so is C#, and when you're looking at a batteries included full stack framework you have ONE popular choices - Django or .NET. For PHP it's Laravel (sure, you have other options like Symfony but they are niche), for Elixir its Phoenix. How is it a good thing for Node to have 5-10 competing frameworks that have similar adoption?

> How is it a good thing for Node to have 5-10 competing frameworks that have similar adoption? How is it a bad thing? Again, JavaScript is far more popular than all of those for web related development. The issue is that like you're stating, there isn't a single main option perse. I'd use NestJS.

[deleted]

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

#435

If you can easily switch to a framework like Rails from a SPA, it's probably a sign your app shouldn't have been a SPA. There's too much "defaultism" in our industry.

Agree, unless your UI is very interactive and complex e.g. a photography editing app then you can likely go without an SPA Your designer might be pissed, but your customers probably don't care all that much and your CEO is going to be pleased at the speed, stability and simplicity of what you've created.

Agreed, but additionally you might need/want an SPA because you want to be able to very quickly spin up mobile/desktop apps (e.g. with Capacitor/Electron) or you want a functional offline mode.

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

#436
post #234

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…

There was a lady in one of my previous projects whose job was to maintain the integrity of sensitive financial data (she was doing a lot by hand, as they wanted a human to check every number). In the 2 years or so I worked there, there was not a single mistake from her. I didn't hear much appreciation for her from others, but my CTO used to call her the most important person in the company. Some tools, some people ju…

> there was not a single mistake from her.

how would anyone know if it was only her on this job? :o)

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

#437
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 default Angular structure is pretty verbose, but it's just TS, you can put the files anywhere. Also it seems many people prefer the Vue-style single-file components: https://muhimasri.com/blogs/how-to-create-a-single-file-comp...

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

#438
post #2

I mostly work in Rails, but when I have to hop into a node project, it feels like I'm stepping back into PHP in terms of sheer madness. Barely any convention, lots of repetition and configuration - all things Rails specifically set out to solve.

Your idea of what PHP is is old, that comparison doesn’t really hold. Laravel in particular is extremely advanced similar to Rails.

I've used Laravel and agree that PHP isn't all bad and can be used intelligently. And this is coming from a former CodeIgniter core dev (if you recall). But being real, you've got to admit that most PHP projects aren't in Laravel, they're batshit spaghetti code continually reinventing (or outright ignoring) the standard patterns that come in a boilerplate rails projects.

That probably has more to do with PHP being such an easy language to get started with, inviting a lot of rookies/cowboys to the party.

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

#439
post #436
post #234

Earlier quoted context omitted.

There was a lady in one of my previous projects whose job was to maintain the integrity of sensitive financial data (she was doing a lot by hand, as they wanted a human to check every number). In the 2 years or so I worked there, there was not a single mistake from her. I didn't hear much appreciation for her from others, but my CTO used to call her the most important person in the company. Some tools, some people ju…

> there was not a single mistake from her. how would anyone know if it was only her on this job? :o)

Presumably, her job has effects in the world beyond just her. ;)

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

#440

Earlier quoted context omitted.

Saying that mixins and callbacks are always incomprehensible is silly. They're just a way to pack up code and they can work beautifully. If you don't wanna use them you're gonna have to write the logic in some alternative way, so a bunch of service objects I guess? Does that automatically make code comprehensible - the fact it's using many small classes? I'm sure people can and are writing shitty services as well.

There’s nothing more frustrating than debugging some ruby module with 10 different mixins defining functions with generic ungreppable names like “user”. Then it turns out the mixins have mixins. The common refrain is well, don’t write shitty code then, but all code starts off looking good to the person who wrote it. I guarantee if you have 400 engineers working on a Rails app it will end up in this state because it (…

> The common refrain is well, don’t write shitty code then, but all code starts off looking good to the person who wrote it. I guarantee if you have 400 engineers working on a Rails app it will end up in this state because it (ironically) lacks sane guardrails

This can be said the same of any other framework or language. It is up to your team to organize the code, write documentation, agree upon linting rules and of course encourage best practices. If you’re leaving those decisions to each engineer writing code - thats the problem

Post reply on HN