Why do AI engineers like to put parameters/arguments and retun value all together in a class? Where does this pattern come from?

Follow

@r2qo Can you give me an example, not sure what you mean (and I do a fair bit of AI stuff).

@freemo
class Blah:
pass

def process(that_thing):
func1(that_thing)
func2(that_thing)

def main():
pass_around = Blah()
pass_around.arg_a = 1
process(pass_around)
return pass_around.result.something

@freemo The spaces got truncated. Sorry!
Hope you can get what I mean😂

@r2qo @freemo I'm not an experienced AI practitioner and I don't do that, but object oriented programming(what you're talking about) allows for easier abstraction of concepts and processes, making work at a large scale easier. It may not matter when you make a script or are just playing around, but when you work with other people in one codebase, it can help a lot(from what I understand. I have no experience with it yet).

@lhackworth @freemo Thanks
Is there any reference so I can learn more about this?

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.