The minute-by-minute work of programming is an endless stream of tiny decisions: does this intermediate value deserve a variable of its own? What will I name this variable? Is this enough code to extract into a method?
Much of the time, we don’t even consciously take note of these choices. In his seminal book Smalltalk Best Practice Patterns, Kent Beck tried to give names many of the small decisions he made repeatedly in everyday coding. He wrote:
A pattern is a decision an expert makes over and over.
That book was all about the little choices: of variable naming, of code layout, of when and how to refactor. This garden path is about the same level of code construction: beyond the language fundamentals, but below large-scale domain-modeling patterns. Some of the topics here are directly inspired by Smalltalk Best Practice Patterns. All of them are inspired by experience with the consequences of a momentary decision in writing code.
Beck went on to write:
If you’re programming along, doing nicely, and all of a sudden your program gets balky, makes things hard for you, it’s talking. It’s telling you there is something important missing… Sometimes you need to create a new method, sometimes a new object, sometimes a new variable. Whatever the needed response, you have to be listening before you can react.
This path will help you listen, and give you some suggestions on how to react.
This course is a Graceful.Dev Garden Path, meaning it is a suggested pathway through a curated selection of self-contained topics. Its status is mature: new topics may still be added, but it is a fully fleshed-out course of study.
Prerequisites: This course is accessible to anyone with a comfortable familiarity with Ruby coding. Consider following it as part of the Ruby for Graceful App Development Garden Tour!