Next: Equality expression evaluation: (1
Up: Tips and Tricks
Previous: Copy constructor and assignment
  Contents
There are two cases that benefit greatly from having a structs passed
as the parameter rather than its individual parameter counterpart:
- When passing a large number of parameters to any method. When
parameter list become long, it becomes more difficult to remember
the order of the parameters and even the parameters themselves.
Passing a single struct object relieves this headache.
- If function call order is important, make a single function that
wraps the sequentially called methods and takes a single struct as
the parameter. This eliminates the need for Waldo to know that the
methods need to be called in a particular order and makes it easier
to pass the parameters.
The following listing shows some methods in serious need of parameter
passing help:
43#43
Should be changed to:
44#44
Falko Kuester
2001-08-24