It\'s mentioned in several Ruby style guides that you should \"Never use then.\" Personally, I think the \"then\" keyword allows you to make code denser, which tends to be
If I remember correctly, then is just one of the delimiters to separate the condition from the true part (semicolon and newline being the others)
if you have an if statement that is a one-liner, you'd have to use one of the delimiters.
if (1==2) then puts "Math doesn't work" else puts "Math works!" end
for multi-line ifs, then is optional (newline works)
if (1==2)
puts "Math doesn't work"
else
puts "Math works!"
end
Could you post a link to one of the style-guides that you mention...