10 May 2012 04:37
passing via instance variable or regular ()
sam jam <lists <at> ruby-forum.com>
2012-05-10 02:37:00 GMT
2012-05-10 02:37:00 GMT
def first
name = "sam"
last(name)
end
def last(first)
name = first + " " + "jam"
end
versus
def first
<at> name = "sam"
last
end
def last
name = <at> name + " " + "jam"
end
I am new to ruby and programming. I see that both of these ways work.
When I was first starting I tended toward the first way, but lately I
have
been tending toward the second way. Does it make much difference?
edit: saying brand n-3-w means my post contains spam? lol...okay first
starting then.
--
--
Posted via http://www.ruby-forum.com/.
RSS Feed