... | @@ -17,7 +17,7 @@ Functions should have a small number of arguments. No argument is best, followed |
... | @@ -17,7 +17,7 @@ Functions should have a small number of arguments. No argument is best, followed |
|
Output arguments are counterintuitive. Readers expect arguments to be inputs, not out- puts. If your function must change the state of something, have it change the state of the object it is called on.
|
|
Output arguments are counterintuitive. Readers expect arguments to be inputs, not out- puts. If your function must change the state of something, have it change the state of the object it is called on.
|
|
|
|
|
|
|
|
|
|
__Output Arguments__
|
|
__Output Arguments (page 45)__
|
|
|
|
|
|
Arguments are most naturally interpreted as inputs to a function. If you have been programming for more than a few years, I’m sure you’ve done a double-take on an argument that was actually an output rather than an input. For example:
|
|
Arguments are most naturally interpreted as inputs to a function. If you have been programming for more than a few years, I’m sure you’ve done a double-take on an argument that was actually an output rather than an input. For example:
|
|
|
|
|
... | | ... | |