Project

General

Profile

Actions

Patch #7770

closed

use unless in control structures where it improves readability

Patch #7770: use unless in control structures where it improves readability

Added by Anonymous over 15 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
-

Description

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


Files

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

Updated by Jean-Baptiste Barth over 15 years ago Actions #1

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.

Updated by Anonymous over 15 years ago Actions #2

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

Updated by Go MAEDA over 2 years ago Actions #3

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Fixed in r22987.

Actions

Also available in: PDF Atom