Answers for "which is better for a better code.function or class"

0

which is better for a better code.function or class

class Person(object):
    def __init__(self, arg1, arg2):
        self.arg1 = arg1
        self.arg2 = arg2

    def compute(self, other):
        """ Example of bad class design, don't care about the result """
        return self.arg1 + self.arg2 % other
        
fuction thinks function is better,but probably class is everything.
Posted by: Guest on September-07-2020

Code answers related to "which is better for a better code.function or class"

Browse Popular Code Answers by Language