Permalink
Browse files

Don't stipulate a block style.

In practice, we don't enforce this.
  • Loading branch information...
fatbusinessman committed Mar 4, 2013
1 parent dca9b31 commit 0f03a1874c092f4285af114501b17cf9f2e08712
Showing with 1 addition and 14 deletions.
  1. +1 −14 ruby.md
View
15 ruby.md
@@ -219,27 +219,14 @@
end
```
-- Use the [Weirich block style](http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc):
- `do...end` for blocks that perform actions (that have side effects) and
- `{...}` for those that return a value. Avoid side-effects in a
- functional-style block whose value you will use.
-
- Freely use single-letter mnemonics for block variables within a single
+- Freely use single-letter mnemonics for block variables within a single
line.
Never chain `do...end`.
```ruby
names = ["Bozhidar", "Steve", "Sarah"]
- # bad
- names.each { |name| puts name }
-
- # good
- names.each do |name|
- puts name
- end
-
# bad
names.select do |name|
name.start_with?("S")

0 comments on commit 0f03a18

Please sign in to comment.