Names for modules and functions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Wagner

    Names for modules and functions

    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

    #2
    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:

    This document gives coding conventions for the Python code comprising the standard library in the main Python distribution. Please see the companion informational PEP describing style guidelines for the C code in the C implementation of Python.


    (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

    Comment

    Working...