Deal with this

I’m trying to learn Objective C at the moment so I can write my first iPhone app (this time next year, we’ll be millionaires).

Objective C is just about the ugliest language that I have ever come across (and I have coded in COBOL and Ada).

That makes it all the more frustrating to read the trailer for the new version of Ruby.

  suits = %w{ C D H S }
  ranks = [ *’2′..’10’, *%w{ J Q K A } ]
  deck = suits
  .product(ranks)
  .map(&:join)
 
  hands = deck
  .shuffle
  .each_slice(13)
 
  puts hands.first.join(“, “)

Could it be any simpler?

(I don’t know what the ampersand thing does either).

It’s hard to believe that my beautiful iPad is full of nasty Objective C.

Published by

Ragged Clown

Based in San Jose, California

2 thoughts on “Deal with this”

Leave a Reply

Your email address will not be published. Required fields are marked *