Ruby was designed to not make you want to throw your laptop. Unlike Java, which makes you want to quit programming. Created by Yukihiro "Matz" Matsumoto in 1995, Ruby was built on the idea that code should be fun to write and read. Sounds cheesy, but it actually works.
The "Make Coding Not Suck" Philosophy
Everything in Ruby is an object, including numbers. Yes, even 5.times
works, which is either brilliant or completely insane depending on your background. At least when Ruby breaks, the error usually makes sense.
Expressive Syntax: Ruby reads like English. users.select(&:active?)
is way cleaner than whatever the hell other languages make you write. Though that &:
syntax will confuse your coworkers from Java.
Multiple Ways to Do Things: Python fanboys love their "one obvious way," but Ruby says "express yourself however feels natural." Some call it flexible, others call it chaotic. They're both right. You can write the same thing five different ways, which is either liberating or terrifying.
Duck Typing: If it responds to the methods you need, Ruby doesn't care what type it is. This saves tons of boilerplate code and makes prototyping incredibly fast. Until you pass a string to something expecting an integer and wonder why your app crashed.
Where Ruby Stands Today
Ruby was painfully slow before YJIT. Ruby 3.4.0 finally makes it less embarrassing, though Go developers still laugh at our benchmarks. The latest improvements include:
- YJIT (Yet another Ruby JIT): Makes Ruby noticeably faster. Your Rails app that took 300ms might drop to 200ms. Still not fast, but less embarrassing. YJIT works great on ARM Macs now with Ruby 3.4 - finally fixed the Apple Silicon issues.
- Prism Parser: New default parser that actually gives you useful error messages instead of cryptic bullshit. Before this, Ruby would just say "syntax error" and leave you to figure out what line fucked up.
- Modular Garbage Collection: More ways to configure memory management that you'll never use. Unless you're debugging memory leaks at 3am, stick with the defaults.
- New
it
Parameter: Syntactic sugar that makes blocks slightly less verbose. So now you can write[1,2,3].map { it * 2 }
instead of[1,2,3].map { |x| x * 2 }
. Revolutionary stuff.
Real Production Usage (Not Just Marketing Examples)
Ruby runs some massive platforms, which always surprises people who think it's just for prototypes. GitHub hosts the entire world's open source code on Rails - that's not exactly a toy project. Shopify processes billions in e-commerce transactions with Ruby at its core, proving it can handle serious money.
Don't let GitHub and Shopify fool you though - getting Ruby to scale requires serious engineering. GitHub runs on Rails and handles millions of git operations daily - that's not exactly a toy workload, but they have teams dedicated just to performance optimization. If you're planning the next TikTok, use Go. If you're building a normal web app that needs to ship fast, Ruby's fine.
The 187,000+ gems ecosystem means someone has probably solved your problem already, though half the gems haven't been updated since 2018. Like that JSON parser gem everyone uses that hasn't been updated since Rails 4. Popular gems like Devise, Sidekiq, and RSpec power most Ruby applications. Just pray the gem you need doesn't have a critical security vulnerability from 2019 that never got patched.