RubySource: Getting to Grips with Blocks

Tweet

When making the switch to Ruby from a PHP background, one of the grayest areas for me was blocks. Blocks are everywhere in Ruby and not having a good understanding of them will stall your learning past the “novice” stage. When you first start out with Ruby you will inevitably use blocks exclusively for iteration. Hello Blocks 3.times n times” } The code above must be the “hello world” of blocks, and from that single line we get alot of what Ruby is all about

Continue Reading:
RubySource: Getting to Grips with Blocks

Free JavaScript: Novice to Ninja Sample

Get a free 32-page chapter of JavaScript: Novice to Ninja and receive updates on exclusive offers from SitePoint.

No Reader comments