H
Hal Vaughan
While I don't see that there would be an actual "right" answer to this, I'm
sure experienced programmers can say what tends to work and what doesn't.
I have a situation where I will be passing one object to another so it can
be configured and used internally. I could pass it with a number of
parameters, probably 5 or 6, or I could pass it with only a few parameters
and have all the rest specified with different method calls.
Does it tend to be easier, in the long run, to have one call with a lot of
parameters (which can be hard to keep track of without an IDE prompting
you) or does it tend to work better to keep the parameter list short and
use several calls? My thought is that the former wold probably work
better, especially if I use the class I'm writing months later, after
having forgotten the internals, since it's easier to keep the parameters
straight than to remember that several calls have to be made to set
everything up.
I'm wondering if more experienced programmers have any experience or
comments that indicates whether a long list of parameters or a number of
different method calls tend to work better.
Thanks!
Hal
sure experienced programmers can say what tends to work and what doesn't.
I have a situation where I will be passing one object to another so it can
be configured and used internally. I could pass it with a number of
parameters, probably 5 or 6, or I could pass it with only a few parameters
and have all the rest specified with different method calls.
Does it tend to be easier, in the long run, to have one call with a lot of
parameters (which can be hard to keep track of without an IDE prompting
you) or does it tend to work better to keep the parameter list short and
use several calls? My thought is that the former wold probably work
better, especially if I use the class I'm writing months later, after
having forgotten the internals, since it's easier to keep the parameters
straight than to remember that several calls have to be made to set
everything up.
I'm wondering if more experienced programmers have any experience or
comments that indicates whether a long list of parameters or a number of
different method calls tend to work better.
Thanks!
Hal