From: roob noob Date: 2012-05-18T03:04:51+09:00 Subject: Re: what is going wrong here? The case of the noob not understanding initialize Honestly I see very little difference between " message = "whatever" encrypt(message) #returns the AES-256 encryption of message " and " @message encrypt #returns the AES-256 encryption of @message " except that with an instance variable I can pass the value seamlessly to where it needs to go without sending it down the call chain and keeping track of a bunch of variables and changes to the variable. class AddNumbersAndLetters def get_input input = gets.chop add_numbers(input) end def add_numbers(input) numbers_added = input + "123" add_letters(numbers_added) end def add_letters(input) letters_added = input + "abc" end end does not look as nice to me as class AddNumbersAndLetters def get_input @input = gets.chop add_numbers add_letters end def add_numbers @input += "123" end def add_letters @input += "abc" end end especially if there are a lot more methods involved and I would otherwise need to keep passing input down the call chain with (), especially if I want to add numbers and then add letters and then add numbers again and then add letters again, which just becomes a mess passing with () but with @ it is as simply as doing this add_numbers add_letters add_numbers add_letters However, enough Rubyists have told me to avoid using instance variables in this way that I will take your advice. I don't personally think it is the intuitive way to do things or that it makes it easier though. -- Posted via http://www.ruby-forum.com/.