What are the Ruby Gotchas a newbie should be warned about?

Posted by MiniQuark on Stack Overflow See other posts from Stack Overflow or by MiniQuark
Published on 2008-12-16T20:46:18Z Indexed on 2011/01/04 18:53 UTC
Read the original article Hit count: 228

Filed under:
|

I have recently learned the Ruby programming language, and all in all it is a good language. But I was quite surprised to see that it was not as simple as I had expected. More precisely, the "rule of least-surprise" did not seem very respected to me (of course this is quite subjective). For example:

x = true and false
puts x  # displays true!

and the famous:

puts "zero is true!" if 0  # zero is true!

What are the other "Gotchas" you would warn a Ruby newbie about?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about gotchas