MicroISV on a Shoestring logo

MicroISV on a Shoestring

by Patrick McKenzie http://www.kalzumeus.com

Practical Metaprogramming with Ruby: Storing Preferences

The other day on Hacker News, commenting on a recent Yehuda Katz explanation of the nuts and bolts of metaprogramming, I mentioned that I though discussions of programming theory are improved by practical examples of how the techniques solve problems for customers. After all, toy problems are great, but foos and bars don't get me home from the day job quicker or convince my customers to pay me money.

My claim: Metaprogramming allows you to cut down on boilerplate code, making your programs shorter, easier to write, easier to read, and easier to test. Also, it reduces the impact of changes.