[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: check for duplicate routine names?

Pavel A. Romashkin (pavel.romashkin@noaa.gov) writes:

> My take on it, avoid routines with generic names. It is tempting to
> write a program called "Just_Doit.pro", but it pays to add
> "prj1_just_doit.pro", unless you are writing a *library* function that
> will be used universally by your other projects. 

Good advice here, and one I learned after being
knocked senseless more times than I care to admit.

Here is a rule for you and two corollaries. 

   The *last* program module in the file should 
   have the same name as the file. This is also 
   called the "command name" or "command module".

   Any other program modules in the file will be
   utility routines for the "command" module. They
   will all have the command name pre-pended to
   their actual names to remind you of their role
   and to keep you out of a LOT of hot water.

   If a utility routine needs to be used by 
   another command module, then that utility
   routine has moved up in life (some will say
   it has "transcended its stature"). Move it
   into it's own command module file and put
   it on your path.

This is know as the "Evolutionary Path of Program
Development". Follow this and life will be easy. :-)



P.S. Let's just say I haven't been able to put
down Ken Wilber's new update of his book "A 
Brief History of Everything." What a wonderful

David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155