Names for modules and functions

Discussion in 'Python' started by Jeff Wagner, Dec 2, 2003.

  1. Jeff Wagner

    Jeff Wagner Guest

    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
    Jeff Wagner, Dec 2, 2003
    #1
    1. Advertising

  2. Jeff Wagner

    Logan Guest

    On Tue, 02 Dec 2003 05:18:15 +0000, Jeff Wagner wrote:

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

    --
    mailto: logan@phreaker(NoSpam).net
    Logan, Dec 2, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paddy McCarthy
    Replies:
    3
    Views:
    706
    Anthony J Bybell
    Sep 24, 2004
  2. Bob
    Replies:
    1
    Views:
    381
    Lucas Tam
    Jul 30, 2004
  3. Xiangliang Meng
    Replies:
    1
    Views:
    1,590
    Victor Bazarov
    Jun 21, 2004
  4. fBechmann
    Replies:
    0
    Views:
    399
    fBechmann
    Jun 10, 2004
  5. wanwan
    Replies:
    3
    Views:
    427
    Alex Martelli
    Oct 14, 2005
Loading...

Share This Page