News for hackers. Stuff that matters.
Re:The GitHub Styleguide by jeltz on Thursday April 05, 2012 @07:22PM (#3805162)
Indeed, "and" and "or" are excellent for their intended use, for control flow. Like explained by the style guide the Github one is based on. https://github.com/bbatsov/ruby-style-guide

   # boolean expression
   if some_condition && some_other_condition
     do_something
   end

   # control flow
   document.saved? or document.save!
Re:The GitHub Styleguide by 286c8cb04bda on Friday April 06, 2012 @10:42AM (#3807311)
I'm not sold on tossing "and" and "or" out the window, but wouldn't "document.saved? or document.save!" read better as "document.save! unless document.saved?"
Re:The GitHub Styleguide by jeltz on Tuesday April 10, 2012 @09:19AM (#3822000)
Agreed, it is not my example.