From: Tim Hammerquist Date: 2005-12-08T16:37:36+09:00 Subject: Re: They say I write Ruby like Perl Ryan Leavengood wrote: > Steve Litt wrote: > > In future software, what could I do to write > > in a more Ruby-like fashion? > > This definitely doesn't look like idiomatic Ruby, and here are a few > glaring things I can see: > > 1. The general naming convention is lowercase with underscores > for variables and methods. You have sort of a mix of > "runitalltogether" variables, i.e. prevsibling, and then the > CamelCase methods like insertSiblingAfterYou. Those should be > prev_sibling and insert_sibling_after_you (though that last > one is a bit too long.) This recurring label "CamelCase" (or sometimes "camelCase") seems to come up a lot, and I can't help thinking "camel" is a reference to Perl... This is strange for me, as a veteran Perl programmer. I've always read/heard/been told that the preferred method of naming variables in Perl a_var_name style. People who used StudlyCaps or javaCaps were usually accused of having come from either Visual Basic (or other Win32 tech) or Java, respectively. Upon looking, I do see some Perl modules using StudlyCaps (DirHandle, FileCache, ExtUtils, et al), but this is hardly more prominent than Ruby's MatchData, NilClass, FileTest, or ObjectSpace. I guess my comment is two-fold. One, can we really single out Perl as the progenitor of this practice? And two, to state that this naming scheme is not an endorsed practice for variable names to my knowledge. Cheers, Tim Hammerquist