browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need Python help?

Get answers from our community of Python experts on BYTES! It's free.

Names for modules and functions

Jeff Wagner
Guest
 
Posts: n/a
#1: Jul 18 '05
This just might be the weirdest question you have heard yet but what is a good way to come up with
names for modules, function, etc.?

I am trying to come up with meaningful names but keep feeling like I have a new puppy I have to name
(and I was never good at that, either. My dog's name is Buddy).

So, are there any guidelines?

Also, is it ok to name a module and function the same?

--- EnterName.py ---
def EnterName():
...
--- End ---

Jeff



Logan
Guest
 
Posts: n/a
#2: Jul 18 '05

re: Names for modules and functions


On Tue, 02 Dec 2003 05:18:15 +0000, Jeff Wagner wrote:
[color=blue]
> ... what is a good way to come up with names for modules, function,
> etc.? I am trying to come up with meaningful names but keep feeling
> like I have a new puppy I have to name (and I was never good at that,
> either. My dog's name is Buddy).[/color]

I like 'Buddy' :-)

[color=blue]
> So, are there any guidelines?[/color]

To google for 'naming conventions' resp. 'naming scheme' or 'style
guide' might help; but in general, you will only find stuff like 'use
underscores', 'don't use underscores', 'use camel notation', 'don't
use camel notation' etc. and something on the order resp. use of
nouns, verbs etc. (e.g. 'showXmlData' vs. 'XmlDataShow')

You might also want to have a look at the 'Style Guide for Python
Code' by Guido van Rossum and Barry Warsaw:

http://www.python.org/peps/pep-0008.html

(But it does not really help in your special situation :-)

[color=blue]
> Also, is it ok to name a module and function the same?[/color]

Often you will see that a module and its class have the same name
(if the module contains just one class).

Finally, it might help to look at the naming conventions for other
languages. E.g. for C#/.NET you will find very detailed instructions
on how to name stuff (Google, Microsoft website).

HTH, L.

--
mailto: logan@phreaker(NoSpam).net

Closed Thread