Re:Why I Like Ruby
by sigzero on Friday July 16, 2010 @09:52AM
(#1521122)
I really hate raising an exception like that. I am surprised Rubyists like it like he says they do.
[ Parent
| on HN ]
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.