Patch #7770

use unless in control structures where it improves readability

Added by Anonymous almost 12 years ago. Updated almost 12 years ago.

Status:NewStart date:2011-03-04
Priority:NormalDue date:
Assignee:-% Done:


Category:Code cleanup/refactoring
Target version:-


Use unless or until in control structures instead of if ! or while ! where it improves readability.

code_cleanup_ifnot_unless.diff Magnifier (12.5 KB) Anonymous, 2011-03-04 01:43


#1 Updated by Jean-Baptiste Barth almost 12 years ago

I think if blah.present? is easier to read than unless blah.blank? or if !blah.blank?, so we might switch to this in some cases you point out.

#2 Updated by Anonymous almost 12 years ago

yes that does makes more sense indeed. I looked it up here , present? is internally defined as !blank?

Also available in: Atom PDF