Redundant boolean logic 1.0


/ Published in: Ruby
Save to your folder(s)

WTF!


Copy this code and paste it in your HTML
  1. if (!check_part(baz)) then
  2. # do something
  3. end
  4.  
  5. def check_part(foo)
  6. if (foo) then
  7. return true
  8. else
  9. return false
  10. end
  11. end
  12.  
  13.  
  14. # why not just write this:
  15. unless baz
  16. # do something
  17. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.