Function organization strategies

Discussion in 'Javascript' started by Derek Basch, Feb 25, 2005.

  1. Derek Basch

    Derek Basch Guest

    What is the best method for organizing dozens of functions in a
    Javascript file? Alphabetically? According to function purpose? Anyone
    have a tried and true method?

    Thanks,
    Derek Basch
    Derek Basch, Feb 25, 2005
    #1
    1. Advertising

  2. Derek Basch

    McKirahan Guest

    "Derek Basch" <> wrote in message
    news:...
    > What is the best method for organizing dozens of functions in a
    > Javascript file? Alphabetically? According to function purpose? Anyone
    > have a tried and true method?
    >
    > Thanks,
    > Derek Basch
    >


    You can do both. For example:

    function edit_page1()
    function edit_page2()
    function form_build()
    function form_reset()
    function page_search()

    I often identify each function with a short description at the top in a
    comment block.

    /*
    * function edit_page1() -- performs data validation for "page1.htm".
    * function edit_page2() -- performs data validation for "page2.htm".
    */
    McKirahan, Feb 25, 2005
    #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. fabbl

    Test Harness Strategies

    fabbl, Apr 17, 2004, in forum: VHDL
    Replies:
    1
    Views:
    1,049
    Jim Lewis
    Apr 17, 2004
  2. fragmonster

    MultiStep form Strategies

    fragmonster, Sep 22, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,983
    fragmonster
    Sep 23, 2004
  3. jacob navia

    Memory management strategies in C. (long)

    jacob navia, Aug 20, 2003, in forum: C Programming
    Replies:
    7
    Views:
    864
    Chris Torek
    Aug 23, 2003
  4. duncan
    Replies:
    1
    Views:
    361
    Chris Liechti
    May 4, 2004
  5. Guyon Morée

    Web services (xmlrpc) strategies

    Guyon Morée, May 27, 2004, in forum: Python
    Replies:
    0
    Views:
    286
    Guyon Morée
    May 27, 2004
Loading...

Share This Page