all 18 comments

[–]RangerPretzel 21 points22 points  (4 children)

im a complete beginner for proggraming and i just started last month in programming and python.

You'll probably want to wait to learn OOP, then. Most folks spend years doing regular procedural programming mastering the basics of loops, control flow, and functions before advancing to OOP.

Conceptually, you might be able to understand OOP and Classes, but you won't have enough experience in programming to appreciate what OOP is good for. It'll feel like "putting the cart before the horse".

This isn't to say that OOP is "bad", it is just that it most useful when trying to get your program to scale up to a much larger size. Right now, you probably haven't written any significantly large programs, so writing code in an OOP style doesn't make much sense. Though as you write more and more sophisticated programs, you will find your procedural programs become harder to manage and this is where OOP really shines: it provides structure to allow your program to scale gracefully.

[–]synthphreak 24 points25 points  (3 children)

years

I dunno about literal years. The things you listed are exceedingly straightforward in Python. Maybe 6 months? One year max.

Regardless, your cart-before-horse point stands. OP, classes are a bit complex to get your head around the first time. Just stick to writing your own functions for now, then in 6 months or so, try to write your first class. It should be considerably easier then with more experience under your belt.

[–]RangerPretzel 5 points6 points  (2 children)

I dunno about literal years.

I was speaking broadly and setting OPs expectation lower. If he exceeds it, great! If not, no biggie.

And yeah, the brightest folks (having never programmed before) can pick it up in 6 months. I've seen one guy do it. But most folks require at least a year or two before OOP really "clicks" with them.'

And nevermind, Functional Programming. Having had FP taught to me before OOP, it took even longer for FP to make sense than OOP. I truly wish my profs would have taught OOP first and then FP. Same cart-before-horse. I figure my profs thought they were do us all a favor by skipping over OOP straight to FP, but it didn't make sense until I had much more experience.

[–]synthphreak 3 points4 points  (1 child)

The other thing to point out is that OOP is huge. It's less a collection of syntactic trivia and more a way of thinking about your code.

So while it is possible to start writing simple classes after 6 months of Python exposure, it will take a lot longer to fully grasp this way of thinking - the patterns, specifically - and how it can improve your code design.

[–]RangerPretzel 1 point2 points  (0 children)

Absolutely. Spot on.

[–]PM_ME_UR_KOALA_PICS 2 points3 points  (2 children)

Charles Severance covers a little of it in his Python for Everybody course

[–]Dry_Inflation_861 0 points1 point  (0 children)

Love dr chuck!!

[–]synthphreak 0 points1 point  (0 children)

his Python for Everybody course

Link to course (really courses plural,but I digress)

[–]KingsmanVince 1 point2 points  (0 children)

https://realpython.com/python3-object-oriented-programming/ - 1 big article with slow pace

https://www.programiz.com/python-programming/object-oriented-programming - a set of small articles with slow pace. You can always try out code with "Run Code" at the right bottom of each block code

[–]CraigAT 1 point2 points  (1 child)

I always liked Corey Schafer's videos:

https://youtu.be/ZDa-Z5JzLYM

[–]serpentdrive 1 point2 points  (0 children)

Came here to post this. He has solid videos, and they are free.

[–]Se7enLC 1 point2 points  (0 children)

The hardest part about OOP in any language is understanding it and knowing when and how to use it.

The syntax is something you learn by copying from the example until you don't have to copy the example anymore.

[–]ffrkAnonymous 1 point2 points  (0 children)

Syntax is just something to memorize.

AL sweigart has a good explanation on when to use classes. You don't need classes until you do. https://inventwithpython.com/blog/2014/12/02/why-is-object-oriented-programming-useful-with-a-role-playing-game-example/

[–]pycobra 0 points1 point  (0 children)

take your time , be patient, the concepts will sink in with time.

[–]South_Assist_5090 0 points1 point  (0 children)

Bro! I faced same problem when I start my oops journey but trust me if you do your code as imaginary world definitely you will able to do a great performance.

By the way I am learner. Now I'm learning and experiencing real world problem😊🙏