Skip to content

Commit

Permalink
Add a bit of advice about multi-line while/until
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozhidar Batsov committed Jun 24, 2013
1 parent f521fa3 commit 650662d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Expand Up @@ -620,6 +620,28 @@ modules). Never use `::` for method invocation.
end
```

* Never use `while/until condition do` for multi-line `while/until`.

```Ruby
# bad
while x > 5 do
# body omitted
end

until x > 5 do
# body omitted
end

# good
while x > 5
# body omitted
end

until x > 5
# body omitted
end
```

* Favor modifier `while/until` usage when you have a single-line
body.

Expand Down

0 comments on commit 650662d

Please sign in to comment.