From: Niklas Frykholm Date: 2001-09-17T00:40:17+09:00 Subject: [ruby-talk:21266] Re: Exceptions and Ruby [Alva] > Why accessing out-of-range index in Array or not existing > key in Hash doesn't yield exception? This is definately > programming error, so shouldn't the interpretar aid me > in finding it? Now you probably get something like NameError > sooner or later, when you'll try to invoke method on nil, but this > isn't half that descriptive as say IndexError. It is more convenient, allowing you to write, for example, hash[x] ||= 1 instead of hash[x] = 1 if not hash.has_key?(x) If you prefer "safer" programming you can always use fetch or change the implementation of [] class Hash def [](x) fetch(x) end end // Niklas