Am I crazy regarding the style guide for function names?

Dan Bishop danb_83 at yahoo.com
Sat Jun 19 18:28:34 EDT 2004


"Michael Geary" <Mike at DeleteThis.Geary.com> wrote in message news:<10d8shvsq01auf0 at corp.supernews.com>...
> Peter Hansen wrote:
> > Judging by the wording of the "function names" section before
> > and after the edit, the earlier version which "allowed"
> > mixedCase names was merely being descriptive (saying what
> > the codebase currently looked like), while the new version is
> > being *prescriptive* (attempting to force a particular style by
> > defining it as the standard).
> >
> > Personally, I don't like the change, but I also have no intention
> > of paying attention to it.  Now that the editor and tab-wars are
> > over, we have to have _something_ to argue over, don't we?  ;-)
> 
> I'm glad I'm not the only one. :-)
> 
> ClassesLikeThis and methods_like_this sounds like a way to make everybody
> unhappy: people who hate MixedCase and people who hate
> names_with_underscores.

It also has the disadvantage that changing a function from a normal
function to a class constructor (like was done with the built-in
types) forces you to break the naming convention.  In fairness, I
don't name functions with this in mind, either.

> Myself, I'm sticking with ClassesLikeThis and methodsLikeThis for my Python
> and Ruby code. (I don't like underscores at all!)

I use ALL_CAPS_WITH_UNDERSCORES for "constants", but in general I
don't like underscores, and use the same ClassName and methodName
convention that you do.



More information about the Python-list mailing list