Re: optional or interface
- From: Arjen Markus <arjen.markus@xxxxxxxxxx>
- Date: Sat, 31 May 2008 04:53:12 -0700 (PDT)
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.
If you want a hard limit, then I'd say up at most two or three
optional
arguments are acceptable (unless the routine simply sets
configuration
options and does not do much processing, then it really does not
matter much). Beyond that, consider splitting up the routine, as
things
will get out of hand.
Regards,
Arjen
- I'd
.
- References:
- optional or interface
- From: Mike
- optional or interface
- Prev by Date: Re: Binding name
- Next by Date: Re: Garbage in dead zone
- Previous by thread: optional or interface
- Next by thread: NYT disses Fortran
- Index(es):
Relevant Pages
|
|