12 Feb '12, 11pm

do/end

The big remaining question on Ruby coding style is: When should you used { } for blocks, and when should you use do/end? Blocks in Ruby may be written with brace delimeters or do/end delimiters. There is a subtle difference in precedence between the two versions, but for most work the two are identical. So which way do you go? Some folk use { } for one-liners and do/end for multi-liners. Others stick exclusively to either { } or do/end. I tried all of the above, but was never really satisified with any of the guidelines. Here is the guideline I use now: Use { } for blocks that return values Use do / end for blocks that are executed for side effects This has the advantage of using the choice of block delimiter to convey a little extra information. Here’s some examples. # block used only for side effect list.each do |item| puts item end # Block used to return test value list...

Full article: http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc

Tweets

Multiple sources of income versus the 80/20 rule

thefinance.sg 12 Feb '12, 7am

Multiple sources of income versus the 80/20 rule by Jared Seah on February 12, 2012 Multiple sources of income Nowadays, y...

@kohxinfang THE RING CASE is back in stock and ...

indiesin.com 15 Feb '12, 1am

We noticed you have javascript disabled. You'll need javascript enabled to access some of the features on the site, so ple...

Ewing Back!

kixandthecity.com 15 Feb '12, 10pm

Ewing Back Yes sir. Ewing back. That is all. For now. (more...)... » Nike Air Diamond Turf II White Black Detailed Look Fo...