From: ChrisH Date: 2006-09-11T23:45:39+09:00 Subject: Re: string as nil or empty string? Robert Klemme wrote: > aidy wrote: > > Hi, > > > > With everything in Ruby being an object, should a string be initialised > > as an empty string > > >... > However, an additional note: it may be that you have a misconception > about variables in Ruby. Although you named it "a_string" this variable > is typeless and it could hold a reference to *any* Ruby object. So > a_string "is" not a String as long as it doesn't point to one. And you > cannot initialize a String with nil either: ... +1 Robert Every thing is an object, but varaibles are references to objects. If you don't specify an object for a variable to refer to than nil seems the best default, yes? Cheers