I apologize if this was asked elsewhere, but I do not know how else to formulate this question.
I am a physicist and Python is my first object oriented language. I like this language for its clean code, and somehow everything works as intended (by me;).
However, I have one problem, maybe itβs more a design choice, but since my object-oriented programming is self-learning and very simple, Iβm not sure where to go.
So the question is, should I basically pass arguments or manipulate object data directly? Because, for example:
class test(object): ... def dosomething(self, x, y):
gives a much cleaner code than does not skip x, y
, but passes i
and writes self
explicitly each time. Which do you prefer, or is it an object-oriented paradigm that I break?
In terms of performance, this should not change, since the arguments are passed by reference, right?
source share