What are the Ruby Gotchas a newbie should be warned about?
- by MiniQuark
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?