Skip to main content

Ruby

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/ruby

In short

Ruby is a dynamic, object-oriented programming language designed for developer happiness, best known for readable syntax and the Ruby on Rails web framework.

What is Ruby?

Ruby is a general-purpose programming language created by Yukihiro "Matz" Matsumoto in Japan and first released in 1995. Its stated goal is to make programmers happy, so it favors code that reads naturally, like 3.times { puts "hi" }. Ruby became widely known in the mid-2000s through Ruby on Rails, a web framework that popularized the idea of "convention over configuration".

Ruby is dynamically typed and deeply object-oriented: everything, including numbers and nil, is an object with methods. It relies on duck typing, meaning code cares whether an object responds to a method rather than which class it belongs to. Blocks, the chunks of code between do...end or curly braces, are passed to methods like each and map, and metaprogramming lets libraries define methods while the program runs, which is how many expressive mini-languages are built. The standard implementation, CRuby (also called MRI), manages memory with a garbage collector and includes an optional just-in-time compiler for hot code.

Ruby is used mostly for web applications and APIs, as well as scripting, automation and developer tooling. Reading Ruby is often compared to reading plain English: method names can end in ? for questions like empty? or in ! for methods that change the object in place, which makes intent visible at a glance.

Ruby is most often compared with Python. Both are dynamic, garbage-collected, interpreted languages with clean syntax, but Python prefers "one obvious way to do it" and dominates data science and machine learning, while Ruby embraces many ways to express the same idea and is strongest in web development. Ruby code also leans on blocks and method chaining, where Python tends to use comprehensions and explicit loops.

Key takeaways

  • Ruby is a dynamic, object-oriented language focused on readability and developer happiness.
  • Everything in Ruby is an object, including numbers and nil.
  • Blocks and metaprogramming make concise, expressive code possible.
  • Its best-known use is web development with the Ruby on Rails framework.

Example

Blocks and method chaining in Rubyruby
# Blocks pass behavior to methods like select and map
orders = [
  { item: "book", price: 12 },
  { item: "lamp", price: 45 },
  { item: "pen", price: 3 },
]

expensive = orders.select { |o| o[:price] > 10 }
                  .map { |o| o[:item].upcase }

puts expensive.inspect                          # ["BOOK", "LAMP"]
puts "Total: #{orders.sum { |o| o[:price] }}"   # Total: 60

Readers ask

Is Ruby still used today?

Yes. Ruby is actively developed, with a new version released every December, and many long-running web applications and newer startups continue to build on Ruby on Rails.

What is the difference between Ruby and Ruby on Rails?

Ruby is the programming language. Ruby on Rails is a web framework written in Ruby that provides routing, database access, templates and other tools for building web applications quickly.

Is Ruby faster or slower than Python?

Performance depends heavily on the workload and version, and both are generally slower than compiled languages like Go or Java. The choice between them usually comes down to ecosystem, libraries and team preference.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings