DEV Community

Discussion on: 10 CODING MISTAKES THAT MAKE YOUR CODE SMELL

Collapse
 
eljayadobe profile image
Eljay-Adobe

I agree with this. Having a function with no arguments means the function only has a side-effect, or operates on variables external to the function. It is far better to pass in all parameters to the function than having a function that is entangled with external variables (including member object variables, which are "global" to the function, even if the function is a member function of the same object).