Link to original Medium article I had published earlier with the same name. I’m migrating from Medium to WordPress, a delightful experience which I may make its own blog post 🙂

I have wanted to read in detail about someone’s experience going from Spring Boot to Ruby on Rails, but have not yet found a piece of writing online that satisfies this desire, so I’m going to write it myself 🙂

I have been writing Spring Boot, Java, and JavaScript professionally for about four years. It’s been a decent experience, but Java and Spring have always left me wanting a little more in terms of general ease of use and quality of life. Also, the vast ecosystem of Java was kind of weighed down by general overabstraction and overnegineering. While I could see where the desire for flexibility and modularity came from in Java, and I did learn some nice tricks, like making separate classes for data objects rather than abusing primitive types, I found that in practice, it made doing straightforward things in a straightforward way a bit difficult

I dabbled in Rails on and off for a while for several years, but I hadn’t really used it to build stuff until about a year ago. I was instantly hooked!

Stuff I liked about Rails

I dabbled in Rails on and off for a while for several years, but I hadn’t really used it to build stuff until about a year ago. I was instantly hooked! In terms of things I enjoy about using Rails, I’ve loved using generators to write a lot of code for me. Also, the resulting code from the generators has a lot less boilerplate than Java and Spring Boot, and the Rails framework is opinionated enough that you know where to look for things, as opposed to the Spring Boot approach, where you could organize your application a bunch of different ways, even if you started with the same building blocks

I found that configuring a Rails app to work on multiple machines to not be as big of a deal as I thought

Stuff I missed from Spring Boot

There are some features that I still miss when working in Rails. I primarily do my side projects in RubyMine, and it has decent linting, but due to the fact that Ruby isn’t a compiled language like Java, it can’t catch type and syntax errors at compile time. Java tends to be less of a hassle to run on different platforms, which can be an issue for me, since I sometimes run Windows on one of my computers. This can be an advantage that makes it somewhat smoother to set up a Java project, if you’re already familiar with the Java ecosystem, whereas even if you know Ruby and Rails, compiling native extensions can be a bit tricky on Linux (I did try to remedy this for Ubuntu-based systems by making a PR)

Java’s verbosity can also be somewhat helpful when adjusting to a new project, whereas Ruby and its brevity can initially make it a bit more difficult to reason about a new system

In fairness, however, Spring Boot does depend on annotations to run web applications, which can lead to some confusing errors when missing annotations, as well as confounding, magical behavior, in both Boot and Rails, albeit from different root causes

Compared to Java and Spring Boot, I also do worry about performance when working in Rails, sometimes. Java’s love of abstraction and indirection does impact its performance somewhat, but in general, an optimized Java stack is definitely going to outperform an optimized Ruby stack. The question is simply if your app needs the performance boost

The vast majority of apps, arguably do not benefit from the performance characteristics of the language nearly as much as from the decreased time to MVP that Rails apps enjoy

Overall, I really like what Rails has to offer, and it’s now my go-to web framework for side projects. I also wouldn’t mind using it for my day job, and I think we as web developers have forgotten some of the lessons we learned during the era in which Rails was much more popular. I don’t think the industry necessarily benefits from moving to full-stack JavaScript applications, because we now often have to reinvent the wheel, even for simple apps, whereas web frameworks like Rails and even Spring Boot do a good job of providing most of what is needed out of the box


Discover more from Shaffan Mustafa's Blog

Subscribe to get the latest posts sent to your email.

Posted in

Leave a comment