Programmer Books

Metaprogramming Ruby 2: Program Like the Ruby Pros [PDF]

Metaprogramming Ruby 2 Program Like the Ruby Pros

Ruby inherits characteristics from various languages—Lisp, Smalltalk, C, and Perl, to name a few. Metaprogramming comes from Lisp (and Smalltalk).

It’s a bit like magic, which makes something astonishing possible. There are two kinds of magic: white magic, which does good things, and black magic, which can do nasty things.

If you discipline yourself, you can do good things, such as enhancing the language without tweaking its syntax by macros or enabling internal domain-specific languages. But you can fall into the dark side of metaprogramming.

Ruby trusts you. Ruby treats you as a grown-up programmer. It gives you great power, such as metaprogramming. But you need to remember that with great power comes great responsibility.

Enjoy programming in Ruby.


You can also get this PDF by using our Android Mobile App directly: