Chapter 6

Functional Programming

Having learned how to define functions and apply them in a couple of different contexts, now we’re going to take our programming to the next level by learning the basics of functional programming, a style of programming that emphasizes—you guessed it—functions. As we’ll see, functional programming also heavily uses blocks, which gives us a good opportunity to reinforce the material from Section 5.4.

This is a challenging chapter, and you may have to get in some reps to fully grok it (Box 6.1), but the rewards are rich indeed.

Get Learn Enough Ruby to Be Dangerous: Write Programs, Publish Gems, and Develop Sinatra Web Apps with Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.