Friday, July 9, 2010

[Rails] Re: CamelCase and Underscores

MattB wrote:
>> variable_name
>> method_name
>
> But why?! Since methods don't need (), how are we supposed to
> instinctively know what's a method and what isn't when reading someone
> elses code? (Or our own when we've forgotten what we wrote!)
>
> Matt.
>
> PS. Anyone play spot the Ruby Newbie, score 10 points!

variable_name = something
Object.method_name

If you are inside a class

def instance_method
self.method_name = something
variable_name = method_name
end

^^
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate