by skrtskrt · 4y ago · 0 comments
Need to add functionality to something? Don't think! Just add an argument with a default to the current behavior, all the way up and down the stack.
Now you have just one API that does everything! Just set 20-40 parameters to decide the behavior.
What I don't like though is when all those options are hidden behind two-stars keyword argument and it is difficult to understand what options are allowed, what they mean, what type they have and so on:
def example(**options): ...