OOP private method parameters coding style
Posted
by
Jake
on Programmers
See other posts from Programmers
or by Jake
Published on 2011-11-29T17:49:13Z
Indexed on
2011/11/29
18:01 UTC
Read the original article
Hit count: 297
object-oriented
After coding for many years as a solo programmer, I have come to feel that most of the time there are many benefits to write private member functions with all of the used member variables included in the parameter list, especially development stage.
This allow me to check at one look what member variables are used and also allow me to supply other values for tests and debugging. Also, a change in code by removing a particular member variable can break many functions. In this case however, the private function remains isolated am I can still call it using other values without fixing the function.
Is this a bad idea afterall, especially in a team environment? Is it like redundant or confusing, or are there better ways?
© Programmers or respective owner