+ 2

In general programming, what is the actual purpose of classes? Wouldn't typical functions work just well?

29th Jun 2018, 3:46 PM
Nick
Nick - avatar
8 Answers
+ 6
「HAPPY TO HELP」 That way I learned OOP in python was like eating rice with fork I hope to work with classes soon 😇
29th Jun 2018, 5:34 PM
ᏳoƊoԲᎮc !
ᏳoƊoԲᎮc ! - avatar
+ 5
Marco Polidori lol soup xD Thanks man I will look up for it 😊
29th Jun 2018, 5:43 PM
ᏳoƊoԲᎮc !
ᏳoƊoԲᎮc ! - avatar
+ 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 😓😂
29th Jun 2018, 5:50 PM
ᏳoƊoԲᎮc !
ᏳoƊoԲᎮc ! - avatar
+ 3
GODOFPC as long as it is not like eatin soup with a fork 😉
29th Jun 2018, 5:38 PM
Marco Polidori
Marco Polidori - avatar
+ 2
there is actually a very nice tutorial on youtube on oop in python by Corey Schafer if you are interested.
29th Jun 2018, 5:40 PM
Marco Polidori
Marco Polidori - avatar
+ 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
29th Jun 2018, 4:09 PM
Marco Polidori
Marco Polidori - avatar
0
classes are used to store data and methods, functions aren't
29th Jun 2018, 3:58 PM
hinanawi
hinanawi - avatar
0
「HAPPY TO HELP」 Yes, I've known Python for a while, but have never previously found a real use for classes. Lol
29th Jun 2018, 4:07 PM
Nick
Nick - avatar