News for hackers. Stuff that matters.
Re:Why I Like Ruby by sigzero on Friday July 16, 2010 @09:52AM (#1521122)

  raise "Hey dude! Where's My Variable Assignment" if my_variable.nil?
I really hate raising an exception like that. I am surprised Rubyists like it like he says they do.
Re:Why I Like Ruby by substack on Friday July 16, 2010 @11:14AM (#1521374)
I prefer:

    my_variable or raise 'Hey dude! Where's My Variable Assignment'
or else:

    my_variable.nil? and raise 'Hey dude! Where's My Variable Assignment'
since it puts what's being tested in front like with if/then but is also syntactically light-weight.
Re:Why I Like Ruby by robconery on Friday July 16, 2010 @04:10PM (#1522359)
I could be completely wrong - I do like the "or" syntax as well - reads much better.