Ruby
PopularA dynamic, object-oriented language designed for programmer happiness — and the language behind Ruby on Rails.
Ruby
Getting Started
What Ruby is, the philosophy behind its design, and why it reads more like English than most languages.
Getting a working Ruby environment set up on your machine, and why a version manager beats a system-wide install.
Writing, saving, and running a real .rb file, and the handful of building blocks every Ruby script leans on.
Syntax & Types
How Ruby names things, and the symbol type that trips up most newcomers coming from other languages.
The built-in types you'll use constantly -- numbers, strings, booleans, arrays, hashes, and nil.
Building strings out of variables and expressions the idiomatic Ruby way, instead of concatenating with +.
Control Flow
Branching logic in Ruby, including the modifier form and unless -- two things most languages don't have.
Ruby's answer to switch statements -- more powerful than most, thanks to the === operator working behind the scenes.
while and for exist, but idiomatic Ruby reaches for times, each, and other iterator methods instead.
Collections
The two workhorse collection types -- ordered lists and key/value lookups -- and the core methods you'll use daily.
map, select, reduce, and the rest of the Enumerable module that makes Ruby collections so expressive.
Methods & Blocks
How to write your own methods -- default arguments, keyword arguments, and Ruby's implicit return.
Ruby's three flavors of passable code, and when a chunk of logic is a block versus a proc versus a lambda.
Object-Oriented Ruby
Defining your own classes, initializing state, and the difference between instance and class-level methods.
Building class hierarchies with <, overriding behavior, and calling back up to the parent with super.
How Ruby shares behavior across unrelated classes without inheritance, using include and extend.
Ruby's shortcut for exposing instance variables, and why you should still choose carefully between the three.
Metaprogramming & Errors
How Ruby handles calls to methods that don't exist, and the metaprogramming door that opens.
begin/rescue/ensure, raising your own errors, and why rescuing StandardError beats rescuing everything.
Ecosystem & Best Practices
Ruby's package ecosystem -- installing gems, and using Bundler to keep a project's dependencies reproducible.
What Rails is, how convention over configuration works in practice, and why it's associated with fast prototyping.
A closing checklist of habits that separate idiomatic, maintainable Ruby from code that merely runs.