Hi --

On Mon, 18 Dec 2006, Daniel Finnie wrote:

> Also, before you get into the habit of doing that (see the quote), it's kind 
> of considered bad form and Ruby automatically concatenating strings like that 
> might not happen in future versions.
>
> You can eliminate the double quotations so it is:
> puts "This is the name #{name}"
>
> Or use direct concatenation with the two strings:
> puts "This is the name" + " #{name}"
>
> But that would be silly when you can just move the space over and not have 
> the whole #{} thing:
> puts "This is the name " + #{name}

I think you mean:

   puts "This is the name " + name

:-)  I agree that the first technique (all in one set of quotation
marks) is usually best, both because it doesn't create a new string
for the addition, and because it won't blow up if name isn't a string.
(Though maybe there are times when one would want it to, I suppose.)


David

-- 
Q. What's a good holiday present for the serious Rails developer?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
    aka The Ruby book for Rails developers!
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)