Live data from Hacker News

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

reviewbunny.app

221–230 of 490 posts

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

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

I had similar feelings with Rails. Just memorize this billion convention and you are good to go. Also didn't help that running Rails on Windows was (maybe still is) considered a bad idea.

Same here. Inherited a huge rails code base and it's as bad as any node project. The autoloading has been enabled in the entire project so I have no clue whether a class is defined within the project or is fetched from a gem. I've never grepped this much in my life

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

#222

Have any of you tried .NET?

Yeah but this falls into similar territory. Do you choose ASP.NET MVC? ASP.NET Razor Pages? Blazor? ASP.NET Web API + Angular/React/etc? I think this article is basically saying "stick to the boring stuff that does what you need out of the box". What is that in .NET land though?

Razor pages, that id the boring stuff

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

#223

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…

Rails does, but Ruby is so close to Python and Python has the numerical crowd so you're eventually going to need it anyway if you're successful. I know it sucks, because Rails is better than Django, but at the end of the day I love Ruby but my day job is Python. Also, even though I can never remember capitalization, underscores , pluralization, interfaces in Python[0] at least I don't have to think when I type `and`…

That's an interesting point. I used Rails extensively when I was a web developer. I gave this up when I shifted back to an analytical role and started writing much more numerical code in Python for analysis rather than application development.

If I were to write a web app, my first instinct would be to go back to Rails. However, I do agree with you that much as I like Ruby and Rails, Python would be my overwhelming choice for analytical or numerical code - and I do like Python.

One possibility would be to handle as much CRUD and UI development in rails as possible, and make analytical code available to the app through services in Python.

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

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

It's more like WebSockets let you do do away with SPAs for many of their user cases - see Phoenix LiveView and other implementations of that pattern.

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

#225

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.

I've interviewed a lot of web devs over the years. The distribution on this question is surprisingly bimodal. One group of web devs is great at picking the right tool for the job. Simple web applications get simple solutions. The complex SPA solutions only get brought out for applications that require it. The other group of web devs has learned one very specific tool and they want to build their career around that to…

Requirements like "x years of experience in Angular 1.34" are a hint of which kind you will get ;)

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

#226

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.

Do most people use Django as a server-side framework (no frontend-JS or very minimal JS, may be jQuery)? Or, is it mostly used as an API to interact with the React/Angular/etc front-end framework? What I am trying to get at is do people still build POST-redirect-GET patterns and such for form submissions or they use Django in a more 'modern' way?

You can use either or both... server-side comes out of the box, and is used by the getting started tutorial. API-based is also very common using django-rest-framework.

I'd say it is still a mix of both and both paths are well-supported and well-maintained.

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

#227
post #48
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…

Arrghh... This week was the first in years where I didn't FOMO. And here comes Nest.js. I desperately need an ad blocker though for shiny new tech thingies.

Well, adding

  0.0.0.0 news.ycombinator.com lobste.rs dev.to 
to your hosts file would go a long way but I am not sure I would recommend it. I've decided to not do it.

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

#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 to either already know rails yourself, or be working with a rails guru, which admittedly there are a bunch of those.

At least with a configuration over convention you can just look at the code and figure out what is happening. With rails, there are certain magical things you just Need To Know and the only way to know those things are to already know them before running into it.

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

#229
I've been wondering about when to use something like a SPA and when to use something like Rails recently. My understanding is that the two are getting closer, with React getting stuff like Next with server-side rendering, backend functions and stuff like that, while Rails is getting Hotwire to make richer interfaces easier.

My question is, how do you know when to choose which one? For example, I'm looking to build something that's in the "unbundling Excel" vein. The application will have lots of input from the users, and lots of graphs. It's supposed to be pretty interactive (once again to mimick Excel). And I'd like to build a SaaS out of it. What would you pick, and why? From what I understand a SPA would be better at the "heavy user interactions" part, and a regular MVC framework would be better at everything else. Maybe a combination of the two? But with limited development times, it seems like it would be slower to do that.

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

#230

Earlier quoted context omitted.

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…

"Javascript has such a minimal standard library" My hope is that this has been/will continue to change over time, is this a fare statement? Does anyone know if the various working groups (e.g., WHATWG, W3C, etc.) have the goal of making the JavaScript more robust? My vision is that the standard, built-in APIs would serve as a minimum viable platform that you can build simple to moderately complex applications in with…

You hope and you hope... and then they ship a Set without any useful built-in methods: https://exploringjs.com/impatient-js/ch_sets.html#missing-se...

Because ... variety of reasons, see tis comment thread: https://twitter.com/bakkoting/status/1488363368268251138

Post reply on HN