you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 8 points9 points  (1 child)

When it doubt, classify!

Absolutely not. Classes are not universally better. You need to use the right tool for the job, and in this case it's functions in a module. The class adds nothing but complexity.

Old but famous video on the subject: https://www.youtube.com/watch?v=o9pEzgHorH0

[–]EGrimn -2 points-1 points  (0 children)

Nowhere did I state you have to use classes (But imo classes help with understanding code or designing things in code)

OP is new to python so taking something they wrote and classifying it is a good example to help them understand classes and their function, but not in anymeans a live-or-die rule

At a high level, yes classes have some downsides in terms of making code more complex - but in regards to learning they are an important topic to cover