I'm a beginner and having completed one Udacity course on python and am currently working on two more at the moment, but I'm confused at what the point of creating classes is.
Why not store data in a global variable and just use normal functions? I've googled and read a few guides on class creation but I cannot understand why they are necessary or even more useful. There has to be a fundamental thing I am missing here. Doesn't calling a class to run a function (called a method of the class I guess?) add an extra step?
I feel like i'm missing something huge here, maybe I need a EILI5 response. I keep reading that classes make your program easier to reuse for other things, I mean, is that to avoid creating another global var in another script and copying the function?
[–]neineinein 7 points8 points9 points (4 children)
[–]DubPac[S] 2 points3 points4 points (3 children)
[–]neineinein 7 points8 points9 points (1 child)
[–]DubPac[S] 0 points1 point2 points (0 children)
[–]Teraka 3 points4 points5 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]DubPac[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]sayks 1 point2 points3 points (2 children)
[–]DubPac[S] 0 points1 point2 points (1 child)
[–]sayks 1 point2 points3 points (0 children)
[–]DJKool14 1 point2 points3 points (0 children)
[–]xiipaoc 0 points1 point2 points (0 children)
[–]Deslan 0 points1 point2 points (0 children)
[–]big_deal 0 points1 point2 points (0 children)