In general programming, what is the actual purpose of classes? Wouldn't typical functions work just well? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 6
怌ļ¼Øļ¼”ļ¼°ļ¼°ļ¼¹ ļ¼“ļ¼Æ ļ¼Øļ¼„ļ¼¬ļ¼°ć€ 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
怌ļ¼Øļ¼”ļ¼°ļ¼°ļ¼¹ ļ¼“ļ¼Æ ļ¼Øļ¼„ļ¼¬ļ¼°ć€ 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
怌ļ¼Øļ¼”ļ¼°ļ¼°ļ¼¹ ļ¼“ļ¼Æ ļ¼Øļ¼„ļ¼¬ļ¼°ć€ 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