From: Simon Strandgaard Date: 2004-03-24T02:44:30+09:00 Subject: Re: Need some advice on PickAxe II On Wed, 24 Mar 2004 02:27:23 +0900, Ben Giddings wrote: > Simon Strandgaard wrote: >> I _avoid_ libraries which uses camelCase, luckily many of them >> provide underscore aliases. Thus it would be really nice if Ruby2 enforced >> underscores for varnames + methodnames. I know this may be a religious >> subject... > > Trying to understand your religion here. If both methods and variables > are named with underscores, not camel case how do you distinguish beween > a method that instructs something to read a certain number, and a > variable which keeps track of how many times something was read. > read_number vs. read_number. > > If you name the method "readNumber" it is clear that it's a method, and > that "read_number" is the variable. That's why I think > camelCaseWithLeadingLowercase is better for methods. > In Ruby I don't feel a need to distinguish between methods and variables. However in C++ I do use CamelCase to identify functions and under_scores to identify variables, but thats because functions in C++ needs to be supplied a (); suffix. In Ruby there is no need for a (); suffix. A few times I have found myself changing a variable into a method. I didn't have to change anything, it made me relieved. Why distinguish between methods and variables ? -- Simon Strandgaard