Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't stipulate a block style.

In practice, we don't enforce this.
  • Loading branch information...
commit 0f03a1874c092f4285af114501b17cf9f2e08712 1 parent dca9b31
@fatbusinessman fatbusinessman authored
Showing with 1 addition and 14 deletions.
  1. +1 −14 ruby.md
View
15 ruby.md
@@ -219,12 +219,7 @@
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`.
@@ -233,14 +228,6 @@
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")
end.map { |name| name.upcase }
Please sign in to comment.
Something went wrong with that request. Please try again.