From: Tito Ciuro Date: 2007-10-20T00:09:24+09:00 Subject: Is it always the norm to skip 'return'? Hello, I have a question about skipping the 'return' keyword in a Ruby method. For example: def self.encrypted_password(password, salt) string_to_hash = password + salt Digest::SHA1.hexdigest(string_to_hash) end Being used to work in other languages, this is weird to me. Without looking at the documentation, I have no way of knowing that 'hexdigest' returns a string. Wouldn't the following be easier to understand?: def self.encrypted_password(password, salt) string_to_hash = password + salt return Digest::SHA1.hexdigest(string_to_hash) end Why so many Ruby snippets skip the 'return' keyword? Thanks, -- Tito -- Posted via http://www.ruby-forum.com/.