November 2001
Intermediate to advanced
218 pages
6h 22m
English
We’ll leave the thorny questions like “How much whitespace makes code more readable and how much is distracting?” for another day. If you haven’t already caught onto this theme, the Ruby interpreter will do pretty much what you expect with respect to whitespace in your code.
Whitespace characters such
as spaces and tabs are generally ignored in Ruby code, except when
they appear in strings. Sometimes, however, they are used to
interpret ambiguous statements. Interpretations of this sort produce
warnings when the -w option is enabled.
a + bInterpreted as a+b (a is a
local variable)
a +bInterpreted as a(+b) (a, in
this case, is a method call)
Read now
Unlock full access