For example, I am now learning wxPython, specifically a class' init function:
__init__(self, parent, id=-1, label=EmptyString, pos=DefaultPosition,
size=DefaultSize, style=0, name=StaticTextNameStr)
As a matter of good programming practice, should I memorize the order of the parameters, or just the keywords and call the function using the keywords everytime? Is it better to do the latter for readability?
Memorize? No. That's what the documentation (including source code) is there for.
That being said, sometimes using keyword arguments helps the code clarity, particularly for functions which take a large number of parameters. And you should always strive to write clear code, especially in Python where the source code is meant to supplement the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With