From: James Edward Gray II Date: 2009-11-14T13:21:13+09:00 Subject: Re: Naming conventions -- was: Re: DRYing a Regex On Nov 13, 2009, at 10:11 PM, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > [...] >> As far as underscoring vs. Camel-case goes, I know Rubyists' >> preference, but I bow to Shakespeare's notion that "a rose by any >> other name is just as sweet." > > It doesn't work that way in programming. Good naming practices are an > important part of readable code. As the saying goes, "When in Rome, do as the Romans do." You're speaking our language now and you want to learn to speak it like us, even with our slang. That allows you to communicate with us better so we can learn from each other. > Even Apps Hungarian is not a great idea in OO code. Instead, just use > the type system, so that distance would be a Kilometer object and > correction would be a Foot object. Kilometer.+(foot) could then either > raise an exception or invoke a conversion. I would like to see us move away from considering classes to be types at all in Ruby. Who knows what modules an object has mixed into it and who knows what singleton methods are defined on it. A class, which is what people traditionally take for the type, is just one piece of an object's identity. James Edward Gray II