|
|
|
|
|
by kentt
3406 days ago
|
|
One of the worst parts of Ruby. I can see the argument that it could be better to have save if valid
rather than if valid
save
end
but what I see 9 times out of 10 is things.do each |thing|
foo
bar
baz
end if valid
orreally.long.thing.that.i.try.to.parse.in.my.head if acutally_almost_never_happens which is harder to read since I read top to bottom / left to right, but the flow is bottom to top and right to left |
|
Post-loop structures have the same limitation:
When used correctly, these can become very succinct and clear. The single statement limitation keeps you from going wild in ways that are probably not useful to future readers of the code (including you).