プロジェクト

全般

プロフィール

Vote #69386

未完了

use unless in control structures where it improves readability

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
-
開始日:
2011/03/04
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
0
issue_org_id:
7770
author_id:
4
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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


journals

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.
--------------------------------------------------------------------------------
yes that does makes more sense indeed. I looked it up "here":http://api.rubyonrails.org/classes/Object.html#method-i-present-3F , *present?* is internally defined as *!blank?*
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0