On Sat, Apr 10, 2010 at 7:17 PM, Damian Conway <dam...@conway.org> wrote: > And is it really so hard to teach: "use underscore by default and reserve > hyphens for between a noun and its adjective"? Perhaps it *is*, but > then that's a very sad reflection on our profession.
I'm not sure if the intersection of people who speak English and people who program is better or worse than average when it comes to grammar, but I do know (from editing my share of writing) that the average is very bad and, further, that many programmers do not speak English as a first language, or at all. I'm having trouble imaging any convention that involves mixing word separators being successful. Maybe a completely deterministic one like "hyphens after vowels, underscores after consonants," but that's pretty nonsensical. I think it has to be all hyphens or all underscores within a single method name, with the only wiggle room being a possible convention that dictates a different word separator for different kinds of methods. (My personal preference: methods_like_this(), just like in Perl 5. My second choice: methods-like-this(). Either way, no grammar knowledge required beyond knowing where one word ends and another begins—and even that's not a universal skill!) -John