# Re: ruby gotchas

**URL:** <https://www.ruby-forum.com/t/re-ruby-gotchas/79987>\
**Category:** Ruby\
**Created:** [December 20, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/re-ruby-gotchas/79987 "2006-12-20T19:53:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [December 20, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/re-ruby-gotchas/79987/1 "2006-12-20T19:53:17Z")

</div>

From: Mark G. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> I’ve written up some ruby gotchas that have come up while using ruby.  
> I’m wondering if there are any other gotchas that I should be  
> aware of.  
> The list is available at:  
> [http://hasno.info/2006/12/14/ruby-gotchas-and-caveats](http://hasno.info/2006/12/14/ruby-gotchas-and-caveats)

A nice list. I don’t think I can add any to that, because your list  
largely seems to stem from what violated your personal expectations. For  
example, I’m used to JavaScript and Lua where the logical AND and OR  
operators (by their various names) do act as guards that return the  
first value that answers the question, never ‘producing’ a boolean  
value. Additionally, nil and false are the only non-truth values in Lua,  
too.

One comment about your item #8 - you might want to mention that 1.0/2 or  
1/2.0 _is_ 0.5. Your wording implies (to the novice reader) that you  
need to include ‘mathn’ for math to work properly.
