4 ms·
Most of the Ruby code I've read through almost never uses camelCase for variables; it's almost always some_variable. I prefer to use lowercase + underscores for
by RegEx 15y ago
Most of the Ruby code I've read through almost never uses camelCase for variables; it's almost always some_variable. I prefer to use lowercase + underscores for method names and camelCase for variables. I find this particularly helpful when dealing with argument-less methods that return strings since () is not conventionally used.
- draegtun 15y agoYes Ruby follows the Perl tradition of camelCase for Module::OrClassNames and instead using underscore in variable_names. Interesting Perl6 introduces option of hypenated $variable-names ala Lisp. Damian Conway gave this great comment on underscores vs hyphens on the Perl6 mailing list - http://www.nntp.perl.org/group/perl.perl6.language/2010/04/msg33511.html http://www.nntp.perl.org/group/perl.perl6.language/2010/04/m...