Hi,
Is there a difference between these two pieces of code? Is one of the
two cheaper than the other?
module Hello | module Hello
def hi | def hi
"hi" | "hi"
end | end
alias hello hi | alias_method :hello, :hi
end | end
What if hi was a very long and complicated piece of code, possibly
taking up lots of memory? Is this practical (given that hello will be
a copy of hi), or is it better to say
def hello
hi
end
cordially,
Richard