Monday, May 24, 2010

Is it bad to pass ints, chars, etc through a function that dosen't require them in C++?

for example....





void rabbit ( legs, eyes, ears, fur, ToyotaSupra)





note ToyotaSupra is not needed by rabbit but is still passed through it. Is that bad?

Is it bad to pass ints, chars, etc through a function that dosen't require them in C++?
Yes it is bad. If you don't need to use it why are you passing it? It is not clean code and doesn't make sense if another person is going to go through your code.


No comments:

Post a Comment