Names for modules and functions

J

Jeff Wagner

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
 
L

Logan

... 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).

I like 'Buddy' :)

So, are there any guidelines?

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 :)

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top