From: David Jacobs Date: 2011-02-25T21:49:59+09:00 Subject: Re: Style question --4d67a574_23f9c13c_545 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline I guess Matz could speak to this better than I can, but I think that underscores are an aesthetic choice. They aren't necessarily a pragmatic one, re: strokes involved. Because the underscores are an aesthetic choice, there is no rational way of demonstrating that they're better. However, consider that: 1. Underscores give variable names a flow - they don't disrupt the code around them 2. Underscores mirror standard English prose: it's easy to read underscored variables "without the underscores": Consider: def render(results) # render results end resultsNeedRendering = true render results if resultsNeedRendering results_need_rendering = true render results if results_need_rendering I can tell you anecdotally that 6 years ago, moving from Java, I was very opposed to snake_case. Now, I can't imagine going back to camelCase. David On Friday, 25 February 2011 at 7:28 am, Bill Felton wrote: Hi all, > Quick (I hope) question about preferred style for variable naming. I see reference in various books to a preferred Ruby style of underscores in variable names in preference to camel case. (my_variable_has_this_name vs myVariableHasThisName). > Why? > Two reasons I ask, a better one and a poorer one. The poorer one is that I come from Smalltalk where camel case is standard and expected. > The better one is that camel case seems easier to type, the shift key being both easier to reach and 'more familiar' to the hands than the underscore. > > Thanks! > > Bill > --4d67a574_23f9c13c_545--