3 ms·
Ruby's solution: if cond if cond something else something_else end end That else belongs to the second (closest) if even if I misindent
by pmontra 4y ago
Ruby's solution:
if cond
if cond
something
else
something_else
end
end
That else belongs to the second (closest) if even if I misindent the code like that. Of course Ruby doesn't care about indentation.
- nivertech 4y agoRuby uses closed form - which is a good design, but it doesn't have a separator between the condition and the "then" clause - which is IMO bad. I don't remember whether Ruby's if statement implemented using implicit blocks ...