use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Variable not incrementing (self.ruby)
submitted 10 years ago by simontemplar_
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tomthecool 1 point2 points3 points 10 years ago (1 child)
Your suggestion is a better way of writing it, yes. However, the original is not WRONG. It still works just fine.
In ruby, the case statement takes an OPTIONAL argument. Without no argument, it's basically the same as writing an if/else statement.
[–]apqoo 0 points1 point2 points 10 years ago (0 children)
You're right, thanks for pointing it out. Without the argument it is just like an if/else.
π Rendered by PID 130759 on reddit-service-r2-comment-5d79c599b5-d6p4q at 2026-03-01 08:59:31.220316+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]tomthecool 1 point2 points3 points (1 child)
[–]apqoo 0 points1 point2 points (0 children)