[Tutor] Naming conventions

Kent Johnson kent37 at tds.net
Fri Jan 28 19:41:16 CET 2005


Terry Carroll wrote:
> On Wed, 26 Jan 2005, Sean Perry wrote:
> 
> 
>>And now, for the pedant in me. I would recommend against naming
>>functions with initial capital letters. In many languages, this implies
>>a new type (like your Water class). so CombineWater should be combineWater.
> 
> 
> I hate hate hate hate hate camelcase and will never use it.  In my book,
> if the name has *any* capitals in it, the first letter is capitalized,
> too.  Anything else is unaesthetic.  
> 
> To me, when I have names that are composed of multiple words (say, "rice
> quantity"), I have two approaches: distinguishing the words by case 
> (RiceQuantity) or separating by underscores (rice_quantity).

Separating with underscores is quite common in the Python community, actually it is the preferred 
spelling for library modules. So maybe you should adopt that, just to reduce the confusion when your 
code does have an encounter with the outside world :-)

Kent



More information about the Tutor mailing list