DEV Community

Cover image for Code Smell 10 - Too Many Arguments

Code Smell 10 - Too Many Arguments

Maxi Contieri on October 29, 2020

Objects or Functions need too many arguments to work. TL;DR: Don't pass more than three arguments to your functions. Problems Low mai...
Collapse
 
pyrsmk profile image
Aurélien Delogu • Edited

I don't really follow you on this one. I understand what you want to demonstrate but your solution is using classes as data bags. Also, having too much parameters on a method does not seem to be really the problem, since your PrintSetup class does it too. To me, the big issue here is that the language itself does not support named parameters in function calls. With this it would make the code more readable and maintainable.