On 11/09/06, aidy <aidy.rutter / gmail.com> wrote:
> Hi,
>
> With everything in Ruby being an object, should a string be initialised
> as an empty string
>
> e.g.
>
> a_string = ""
>
> or nil
>
> e.g
>
> a_string = nil
>
> cheers
>
> aidy
>
>
>

I prefer using nil that way I can do if statements like

if  a_string
...
end

instead of

if a_string.empty?
...
end

The first example is more generic as not all objects respond to .empty?

Farrel