-- For one-line functions, put a semicolon before "end", like this:
- def bool_writer *args; attr_writer(*args); end
- (I just started doing this for no real reason, and now I kinda like
- it.)
-
+- I like poetry mode. Don't use parentheses unless you must.
+- The one exception to poetry mode is if-statements that have an assignment in
+ the condition. To make it clear this is not a comparison, surround the
+ condition by parentheses. E.g.:
+ if a == b if(a = some.computation)
+ ... BUT ... something with a
+ end end
+- and/or versus ||/&&. In Ruby, "and" and "or" bind very loosely---even
+ more loosely than function application. This makes them ideal for
+ end-of-line short-circuit control in poetry mode. So, use || and &&
+ for ordinary logical comparisons, and "and" and "or" for end-of-line
+ flow control. E.g.:
+ x = a || b or raise "neither is true"