Mirian Crzig Lennox wrote: > > Concerning Ruby coding style... > > When one is writing a module for Ruby, is there a "preferred" style > for methods names? The built-in ones seem to use all-lowercase > separated by underscores (i.e method_name), while contributed modules > seem to tend to use the Java-style (i.e. methodName). I've wondered > if this is intentional, to help show the difference between built-in > and external classes. > > Anyway... I'm getting to the point in Ruby where I'm starting to think > about contributing modules, and so I would like my code to be > consistent with whatever prevailing convention exists, if any. > Aleksi had this same question some time ago, and the most satisfactory answer at the time was that methods (verbs) tend to use lower case with underscores, e.g. my_method, and classes/modules (nouns) tend to use what you call java-style. e.g. MyClass. But even that is not 100% consistent, and I'm sure there are those who have some other preference. But it makes sense to me, and that is what I would use, where possible. I don't think it has anything to do with built-in vs. external. Guy N. Hurst -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA 23510 (757)623-9688 FAX 623-0433 PHP/MySQL - Ruby/Perl - HTML/Javascript