Mar-09-2019, 04:01 PM
My first piece of advice would be to not program Python like it's Java. The two languages have very different philosophies, especially when it comes to classes.
Do you mean functions or methods? Methods are functions that are part of a class, functions are independent function. Because if the functions are not being used by the class they should be functions. But if they are used by the class (an not elsewhere), they should be methods. Your comment about formatting timestamps made me confused about what you meant here.
Beyond that, it's hard to advise on classes vs. functions without a better understanding of the problem. If you have data that is at least somewhat complex and common functions that apply only to it, I would use classes. If your data is reasonably generic, I wouldn't.
(Mar-09-2019, 02:19 PM)Jackhammer Wrote: The intern who wrote this part, wrote as a class and a lot of functions that are not being used by class, they are used on other parts of modules.
Do you mean functions or methods? Methods are functions that are part of a class, functions are independent function. Because if the functions are not being used by the class they should be functions. But if they are used by the class (an not elsewhere), they should be methods. Your comment about formatting timestamps made me confused about what you meant here.
Beyond that, it's hard to advise on classes vs. functions without a better understanding of the problem. If you have data that is at least somewhat complex and common functions that apply only to it, I would use classes. If your data is reasonably generic, I wouldn't.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures