+ 2
In general programming, what is the actual purpose of classes? Wouldn't typical functions work just well?
8 Réponses
+ 6
「HAPPY TO HELP」
That way I learned OOP in python was like eating rice with fork
I hope to work with classes soon 😇
+ 5
Marco Polidori lol soup xD
Thanks man I will look up for it 😊
+ 5
「HAPPY TO HELP」
Yea to be comfortable with them I need practice
I have some books of python will reach oop soon 🤩 and also The video Marco told about
Whenever I see any software source code the only thing I found is classes 😓😂
+ 3
GODOFPC
as long as it is not like eatin soup with a fork 😉
+ 2
there is actually a very nice tutorial on youtube on oop in python by Corey Schafer if you are interested.
+ 1
classes are much better at describing attributes of objects that are reused often. in other words, writing a class that is called only once in your program can probably be better handled as a method/function.
if you have to the same things over and over, especially creating objects with the same attributes, classes will save you a lot of work.
that of course also applies if you write methods that shall be used by other coders.
a good example is UI programming. you might need 3 push buttons 5 fields etc. you don’t want to reinvent the wheel and plaster your code with repetitive stuff. instead, you call the button class from Qt and pass the features you want e.g.
hope this makes sense
0
classes are used to store data and methods, functions aren't
0
「HAPPY TO HELP」 Yes, I've known Python for a while, but have never previously found a real use for classes. Lol