On 22 Nov 2007, at 16:36, Peter Vanderhaden wrote:

> Alex,
> Thank you very much for your explanation.  I have one question about
> your response.  I don't dispute your statement:
>> Which in Ruby is better written as:
>>
>> puts "Invalid filename entered: #{ARGV[0]}"
> but can you tell me why it's better to use puts than $stdout.print?   
> I'm
> just curious.  Again, thank you very much.
> PV


It's shorter (laziness is a virtue) and more idiomatic, which may or  
may not equal 'better' I suppose. According to 'ri Kernel#puts' (ruby  
1.8.6) Kernel#puts is equivalent to $stdout.puts so it's exactly the  
same, just less unnecessary line noise.

Actually in my 2nd Edition Pickaxe it says that Kernel#puts is  
equivalent to STDOUT.puts which is ever so slightly different, but  
there you go.

Alex Gutteridge

Bioinformatics Center
Kyoto University