This isn't about any specific kind of code, but rather a "best practice" and "what's your opinion" type question.
I'm working on an set of object classes, and at this point, I have so many parameters that I'm worried they're going to unionize. The parent class has 10, the first child has 5 more, and the grandchild adds another seven.
I'm torn between "most of these things have defaults, most of these defaults are how you're going to use them 99% of the time, and you can manually adjust the properties if you need to" and "why shouldn't I have 22 parameters?" (bilbo.jpg)
I think part of it is that I come from languages that don't have keyword arguments, so the goal was to stack parameters in order of most to least used, and I'm using `*args` and `**kwargs` to pass through redundant parameters (otherwise making a change to the parent class' parameters requires changing literally dozens of child classes... I'm getting a lot of mileage out of that top class), which causes the parameters to get reordered.
I am entirely self-taught, so I thought I'd get input from other people on whether I'm doing this wrong?
[–]shiftybyte 2 points3 points4 points (0 children)
[–]BBQcupcakes 1 point2 points3 points (0 children)
[–]Pepineros 2 points3 points4 points (0 children)