Skip to content

Instantly share code, notes, and snippets.

Created January 12, 2017 09:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f904d724aefd87e3ae5c8b695c987f22 to your computer and use it in GitHub Desktop.
Save anonymous/f904d724aefd87e3ae5c8b695c987f22 to your computer and use it in GitHub Desktop.

Why I don't think Ruby is great

This post was inspired by this post on why the author thinks "Ruby is still great" and this tweet stating that Shopify (and others) are successful because of Rails, not despite it.

Now, let me first give a little background. I've been a Rails programmer since late 2006. Before Rails I went through PHP, ASP and ASP.NET (like most people at the time).

Back pre-2010, Rails was a force-multiplier, and to some degree still is. It provided a completely new way to do web development, including code generation and all the necessary tooling out of the box. The deployment story was sad until Heroku came on the scene, but we suffered through it because Rails solved a real problem.

After over 10 years of dealing with Rails' problems, I'm not so enthusiastic anymore. I believe it is impossible to write a high quality application in Rails. By high quality I mean it satisfies two properties

  1. It's easy to implement changes and refactor
  2. It doesn't crash

Why would anyone think Rails is great?

Like I said before, Rails was a force multiplier, it essentially allows a non-programmer to sit down and create a web application.

To say that a business is successful or not because of a framework or language is IMO preposterous, a business is successful because you've solved a problem and made something people want. A business is not successful because what you've made isn't worth anything to people.

However, Rails can help before you even get to that stage. I believe many companies in existence today exist because of Rails, not because Rails is great at anything in particular, but because it gave non-technical people the courage to try to build something.

Why isn't Rails great?

In all my years of experience, I have never seen a high quality Rails application. The first month of Rails development on a new app is great, you're making progress incredibly fast and you're banging out new things all the time. The next couple of months can be a slog and you realize that it's really hard to keep adding things. Usually this is when a team starts writing tests because they realize the situation is not sustainable. After 6 months of work on a Rails application, it has usually ground to a halt and you're spending all of your time untangling a massive nest just to make a minor change.

The worst Rails application I've worked on crashed about 500 times per day on average. If you look at the error-tracker Sentry they give you 10,000 errors a month for free. If you need anything more than the free plan, your application needs to throw 300 errors per day. This is not a strange one-off case, Sentry knows their customers and their pricing is calculated, they know most applications throw more than 300 errors per day.

Now, not all those errors are crashes, but in practice most will be. If you had to tell your boss that you need to upgrade to the paid plan because the application is logging more than 300 errors per day, the correct response from the boss should be "fix those errors then", but it never is; because that would take a massive amount of time and effort, completely contradicting the "productivity" of the framework.

Asking that an application doesn't have bugs is too much to ask, but to ask that it not crash really isn't. Most of the errors in Rails are undefined method XYZ for nil:NilClass, this is a whole class of bugs that compilers have been able to detect for years and years.

Why care about quality?

So, you could ask, why should I care about quality? So what if my application throws some 500's here and there?

I don't have a great answer to this, if your business is actually solving a real problem, people will use your app even if its slow and crashes a lot. Customers will endure a massive amount of pain as long as you solve their problem. Some markets are more sensitive than others, largely depending on the competetive landscape, but this is generally true.

So if having a crappy application isn't actually costing you anything, why bother trying to write something good?

To me, the answer is what Rails had as its mantra for many years "developer happiness". I know I personally enjoy adding value to an application far more than fixing bugs and playing typechecker, something that the computer (theoretically) can easily do for me.

The reality for me over the past 10 years has been that in any Rails application, 80% of time is spent untangling messes to figure out how to make a change, or fixing bugs. Only 20% of time is spent on actually adding value. That ratio should be flipped around, and there are other languages and frameworks out there that try to do just that.

@ripienaar
Copy link

You mistakenly called Rails "Ruby" in the post title.

@khkramer
Copy link

Ruby ≠ Rails

@sideshowcoder
Copy link

undefined method for nil is basically a NullPointerException, which last I looked not a lot of languages solve, only the MLs and Haskells of the world really enforce an Optional...

Many frameworks and languages try to be better but not a lot are, and that greatly depends on your goals what you define as better. Having 0 crashes/errors is not likely a useful business value to add at least not in the beginning where the domain is defined (read startup).

@donpdonp
Copy link

donpdonp commented Jan 12, 2017

This very-ruby-like (but not ruby-compatible) language with type-checking gives a lot of the compile-time error checking you mentioned. It shows what ruby could look/work like.
https://crystal-lang.org/

@dpaola2
Copy link

dpaola2 commented Jan 12, 2017

AKA "I see segfaults all the time when I use Unix. Why doesn't C use garbage collection?"

@marcofognog
Copy link

"In all my years of experience, I have never seen a high quality Rails application"

  • Have you ever seen a high quality application in other languages/frameworks? I know I haven't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment