Live data from Hacker News

Why I believe Rails is still relevant in 2019

devbrett.com

181–190 of 264 posts

Re: Why I believe Rails is still relevant in 2019

#181

Earlier quoted context omitted.

I agree with a lot of what you've described, but 7 years of working in Rails and you never figured out how to turn off lazy loading in ActiveRecord?

I know how to preload associations, but I don't know how to globally disable lazy loading of associations. Do you know a way?

[deleted]

Re: Why I believe Rails is still relevant in 2019

#182

I spent a couple of years dreaming of getting paid to work in Ruby and Rails and about 7 years doing so. There are many things I loved about Ruby, and Rails brought a ton of good ideas to web development, as this post describes (though I don't agree with all the highlights). I've since moved to using Elixir and Phoenix, and then even more recently, done some consulting on a Rails project. So the contrasts are on my m…

Hey, I am so glad to hear this. My sentiments are somewhat similar. My Elixir project didn't get traction so I am back to Rails and some other tech, but definitely Elixir is the future. Now as far as Rails go, this can be my super power. I see a lot of Nodejs project struggle and reinvent things that people in Rails community take for granted. Like Nuxt.js for example.

I haven't used Node, but I think it's funny how they tout asynchronous IO via callbacks. Meanwhile the BEAM has that plus asynchronous computation - you just write synchronous code and let the scheduler pause your BEAM process as needed.

If you don't have to write code to deal with the computer pausing your unix process to run a different one, and you don't have to write code to deal with the VM pausing your code to run garbage collection, why would you have to explicitly write code to deal with a pause for IO?

Re: Why I believe Rails is still relevant in 2019

#183

I think Rails is fine. It gets you up and running super fast. GitHub, Heroku, Basecamp etc. run on Rails and they are doing great. It's popular because it's relatively 'low-code' than other language/frameworks. Ruby is quite simple to get started with and Rails' convention over configuration philosophy gives a lot out of the box. Having said this, it's not all rosy. Rails does buckle under scale, hence LinkedIn and T…

> A huge Ruby backend application becomes quite difficult to reason without a good type system. It's not impossible, just more difficult than say Scala or Haskell or Rust, that have very strong static types.

It also becomes difficult to refactor if you don't have a very good test suite. From personal experience, refactoring an Elm application is way way easier and more error-free than refactoring a Rails app.

Re: Why I believe Rails is still relevant in 2019

#184
post #105

Earlier quoted context omitted.

Having worked with many different languages and frameworks over the years, I have to disagree: when creating web applications, starting from scratch or from a minimal base is massively slower, more error prone and less safe than starting from a well developed and maintained framework, where so many of the things you're going to need have already been solved and battle tested.

A summary of my experience would be: libraries are good, frameworks are bad. (Indeed possibly the best "framework" I ever used was TurboGears which is very deliberately just a collection of dedicated libraries, all of which you can replace piecemeal as and when you need to). Rails raised the bar for how little custom configuration should be necessary to do a simple, straightforward thing. But it turns out being a fra…

To be fair, Rails now makes it much easier to swap libraries if you need to, compared to how it was at the beginning. I agree that that's something useful, but personally I still think that having a sane reference combination to start from is much better than having to choose everything yourself.

Especially in the JS world, I could really feel a "library fatigue" when I had to evaluate so many different alternatives.

Re: Why I believe Rails is still relevant in 2019

#185
The author took a bit of a pot shot at NodeJS (which I do understand why). But I think it's a bit naive to think NodeJS is any more complicated of a stack or problematic as a whole than Ruby -- it's simply not. As someone that's moved between many different stacks, once you're in that stack and being productive, you tend to realize "oh, this is why this is a good stack." From the outside, if you've never used the stack professionally, you tend to get skeptical.

But for me these days, there's very little difference between stacks as to "what's better". For me it's mainly "best tool for the job and who are are your carpenters?"

But these days, NodeJS seems to be the right choice for many of these jobs and it's hard to sit here and knock it. Why?

Unfortunately, Rails suffers from what a lot of other Web stacks suffer from -- the browser requires some level of JavaScript marshalling that all the other stacks have transform to. When you can code on the server and on the client in terms of the same language. It just makes the process cleaner and far more manageable. When an object on the server is the same as the one on the client. Your life just becomes a little less stressful.

And I love other stacks. I'm a Python fan.

But It's really hard to not embrace NodeJS when you've got developers who work on the frontend (Maybe in React, Vue, etc.) and server developers who are on NodeJS and they can speak together, moreover, work within each others codebase and not kill each other.

That doesn't mean Ruby is a bad stack, it just means like all the other stacks, you have to move data between the backend and browser and it's "Oh, I need this change on the server, I'll have to wait for..." -- no, you can do that, if you've got the ability to code in JS, and you're a fullstacker, you can do both.

Re: Why I believe Rails is still relevant in 2019

#186
post #78

I think for what it is - for its paradigm if you will - ruby on rails is an extremely well-designed platform. But I think things have moved on and what was back then seen as the right way (or just fresh new way) is now seen differently. For example - is it really "better" to say 7.even? rather than isEven(7)? (Strict OO vs multi-paradigm/functional programming). Or is the article's example of a data model migration r…

> And why not go for a pure SPA rather than an AJAX-sprinkled compromise between a traditional server-side rendered html app and a SPA?

Not every app needs to be or should be a SPA. IMHO, unless you're creating an actual web application like Pivotal Tracker or Google Docs or etc, then maybe you should go with meat and potatoes server-side rendered html and javascript.

Re: Why I believe Rails is still relevant in 2019

#187
I also work on a Rails system. It does the job and the nice part about it is whenever I need to make tweaks I can easily dive into the code and implement said feature quite quickly. There are a few services I wrote that have a bit of overhead but that's my fault - these typically go untouched as they are part of the backbone. I run this system on two different instances and I will say the difference between a few thousand records and a few million records is noticeable. There isn't any memory leaks that I could detect or n + 1 queries, so I've kind of thrown my hands up. Most importantly though, it's been super reliable. I'll take the slight delay for robustness.

Recently I went the other way and built something with Flask because I felt I only needed something tiny (plus python and ruby are both friendly to read) and kept hearing the negatives about monoliths. It started out refreshing because I only added in what I needed but eventually this started to get a bit annoying as it grew, I felt I was rewriting the wheel often, and I missed the organization and forced convention of Rails. Not to mention gems seemed to have more support and often were more recently updated compared to flask imports. I now want to convert this over to a Rails application.

I think a lot goes into picking what to use, size of team, size of users being served, verasility, and development productivity. It's not always only performance at massive scale (you may never need to handle the traffic Twitter does and if you do I think you're doing pretty well and can weather that storm).

Re: Why I believe Rails is still relevant in 2019

#188
post #106

Earlier quoted context omitted.

Having worked with many different languages and frameworks over the years, I have to disagree: when creating web applications, starting from scratch or from a minimal base is massively slower, more error prone and less safe than starting from a well developed and maintained framework, where so many of the things you're going to need have already been solved and battle tested.

> starting from scratch or from a minimal base is massively slower This isn't the better alternative to frameworks. The better alternative is using libraries and optionally a bootstrap code generator, which is not at all "starting from scratch". The major difference is that you tell the libraries how to work together, rather than the framework telling you how to work. Some frameworks become like a terrible DSL that y…

> > starting from scratch or from a minimal base is massively slower > This isn't the better alternative to frameworks.

I was specifically answering to the remark from the what was at the time the top comment, saying that starting from Rack is the best approach.

Re: Why I believe Rails is still relevant in 2019

#190
post #121

Earlier quoted context omitted.

better than postgresql? and what would that be?

Depends what you were trying to achieve with it; for the various things I've seen it used for a mix of protobuf-in-flat-files, Cassandra, and Spark.

I don't know the kind of work you do, but in the work I do, postgresql offers a lot of bang for your buck and works for me in the majority of all my web apps. The fact that I have one backend that can accomplish so much at good performance is a win for me.
Post reply on HN