An introduction to types in Ruby
Hello everyone!
I started this year by re-learning the Ruby programming language. Ruby is a lovely and elegant programming language, and It was one of my first three languages that I’ve learned back in the day on CodeCademy.
In January, I finished reading the Well-Grounded Rubyist, Fourth Edition book which got me a good start with Ruby. I’m by no means proficient in it yet, but I’ve also bought several Ruby books that I hope to finish reading this year.
The reason for learning a new language every year is that I find it enjoyable to try new things and read books.
In the last three years I’ve read about Rust, Kotlin and Dart, and I’ve also done a few side projects in them.
Back when I was learning Python we had no types, everything was blank and it was difficult to tell what a method was doing by just looking at its signature, luckily for us PEP 484 added type hints, and we could write code like this:
def greeting(name: str) -> str:
return 'Hello ' + name
Ruby also has support for types and the reason I’m writing this article is to show you how to add types to your Ruby project using Sorbet and RBS.
Both approaches are different, let’s explore!
You can read the full article on my blog:
https://nuculabs.dev/programming/2026/01/28/types-in-ruby.html


