3 ms·
You could say the same about a function call or a function that takes an object as an argument - who knows what code lies behind the impenetrable barrier of str
by robertlagrant 4y ago
You could say the same about a function call or a function that takes an object as an argument - who knows what code lies behind the impenetrable barrier of structured or object oriented programming?
- duped 4y agoThat's actually a feature of encapsulation. The object (ideally) is used to abstract away those details so I don't need to know about them, only how to create the object. Encapsulation is a different feature than reuse. The exception is in languages that use that syntax as a way to implement keyword arguments, but I would still ask people to destructure it in the parameter list or at the top of the function so I can see what the arguments are. The point is that when I am looking at a function definition I need to know how to call it. As described all I see is obfuscation to save some keystrokes, not clean code.
- robertlagrant 4y agoBut how would you know how to call it if it takes an object as an argument? How different would the process be for looking at a named standard set of arguments?