Jari Williamsson
12/30/2007 6:09:00 PM
Alan Eden wrote:
> | | @names.each do |name|
> | | | puts "Hello #{name}!"
> | | end
Rewriting like this would then result in a syntax error, following your
suggestion:
@names.each do
|name| puts "Hello #{name}!"
end
And what if tabs and whitespaces are mixed in the code and different tab
settings are used on different machines? This produces hard-to-read code
even today, and your suggestion would make the code unreadable.
> I copied this example from Ruby in twenty minutes, page 4. Look at the
> original and look at the above. Isn't it much clearer?
No, I think it clutters the code, I want Ruby code to be clean.
> Or is there a
> good reason why this isn't done that I'm missing?
Apart from breaking existing code and editors, this doesn't add anything
to the Ruby language. It's in the same league as syntax highlighting. If
you need good formatting, use text a source code formatter or (more
fun!) build one yourself.
Best regards,
Jari Williamsson