Re: optional or interface
- From: Paul van Delst <Paul.vanDelst@xxxxxxxx>
- Date: Mon, 02 Jun 2008 09:22:27 -0400
Arjen Markus wrote:
On 31 mei, 04:38, Mike <Sulfate...@xxxxxxxxx> wrote:Hi
Very often, I need to modify the procedure to fit more extensible
purpose. Then I choose to add more optional arguments in the current
procedure. I don't like to write another similar procedure and use
interface, since there will be lots of similar procedures and then
hard to manage them.
However, it will be harder and harder to write more generic procedures
when demands are more general.
I'd like to ask how you decide which one (or any other one) to be
used.
Thank you in advance.
Mike
There is no crisp answer to that, but consider this:
If your routines are getting too complex, because they have too many
tasks (as indicated by the continual addition of optional arguments),
then it is time to break them up.
Good advice.
My rule of thumb is to make procedures do one one thing, just one thing, and to do that one thing very well.
A search of my source code posts to this newsgroup will show that it is not always easy to do. :o)
cheers,
paulv
.
- Follow-Ups:
- Re: optional or interface
- From: Mike
- Re: optional or interface
- Prev by Date: Re: Fortran 90 Chess
- Next by Date: Re: optional assumed-shape array
- Previous by thread: Re: optional or interface
- Next by thread: Re: optional or interface
- Index(es):
Relevant Pages
|