From: Mike Nelson Date: 2006-05-03T06:04:57+09:00 Subject: Re: More explicit Ruby code Brad wrote: > Kernel.puts("Print this string") > > instead of this: > > puts "Print this string" In this case if I wanted to be more explicit I would use, $stdout.puts "Print this string" which is also the same thing, but also explicitly shows where the printing is going. Either way I'd probably not be so explicit and just stick with puts, unless of course I'm doing something like, def puts_my_stuff_to(thingy, message) thingy.puts "My cool formated message: <#{message}>!" end puts_my_stuff_to $stdout, "Here's my message" In my short experiance with Ruby, the less explicit I am in general, the more I have an easier time of it. This is probably not so true in this case (as far as I know) but getting used to not being explicit, specifically using duck typing, can help the code be less brittle in different contexts. I too am fairly new to Ruby but a long time coder in other languages. I find that the less that I have to be explicit the better it makes me feel about my code. But if being more explicit helps you feel better about your code, then you should probably just do what feels right. -- Posted via http://www.ruby-forum.com/.