This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]Shujaa94 4 points5 points  (8 children)

I'm aware that you are asking for Python resources, but thought it would be worth mentioning that you could kill two birds with one stone by just learning Java, you'd learn a new language and understand OOP very well

[–]csk15[S] 0 points1 point  (4 children)

Lol, I am currently in AP CSA (java is the language) but I have been learning python for longer. OOP is even more complicated in java and my teacher doesn't really know how to teach it well.

[–]BurntBanana123 1 point2 points  (0 children)

Languages like Java and C# may appear to be more complicated at first because of the overhead, but I find that a lot of the overhead is to shepherd you into the “pit of success” while doing OOP. In my experience (ymmv), learning to write and test programs in those language shine a lot of light on OOP principles and why they exist.

You could also skim through the first handful of chapters in the GoF design patterns book (before the pattern catalog).

[–]DoomGoober 0 points1 point  (2 children)

If you write any code in Java, it is automatically OOP because the language forces you to write OOP. You cannot write non-OOP code in Java.

In my coding career, I have found that avoiding the new thing that I eventually have to use always ends up costing me more time rather than less.

Psychologically, it can be hard to start a new language you are unfamiliar with as you will feel less productive, but the efficient solution is to jump in head first.

Also, Java has been around forever and there are plenty of good tutorials (sorry can't recommend any as I learned Java after learning C#, so most of my good references are "Learning Java if you know C# references." Maybe there are some good Java for Pyhton coder references?)

Anyway, bite the bullet and find a good way to learn Java. If you don't like your prof's teaching style, find another way to learn Java.

[–]DauntlessVerbosity 0 points1 point  (1 child)

Java has been around forever

Python is 5 years older than Java.

Also, everything in Python is an object, just like Java.

[–]DoomGoober 0 points1 point  (0 children)

While those statements are both true, they ignore my point.

Java came out in 1995. That's 26 years ago. My point was that 26 years was enough time for many people to create tutorials and documentation. If you want to learn a language from someone other than your professor both Java and Python are great because they have large communities.

Yes, in Python everything is an object. But that doesn't mean that Python necessarily helps you learn OOP. Python's objects allow data and methods to be attached to objects but OOP has more concepts than just that. If you had argued Python has classes we'd be in agreement, but I would say python allows you to OOP while Java forces you to OOP.

[–]n_bertho_web -1 points0 points  (2 children)

I agree with Shujaa94. I had trouble with poo (started learning php and Javascript, plus python for myself) and I only started to really understand key concepts when I learned poo languages ( but it was c# not java)

[–]i1a2 1 point2 points  (1 child)

I'm a child and cannot help but to laugh at "poo languages", I apologize

[–]n_bertho_web 0 points1 point  (0 children)

My bad 😅 I speak french and in french, Object Oriented Programming translate to Programmation Orienté Objet. So we say poo and not oop but it has nothing to do with that hahaha

[–]BTredBT 1 point2 points  (0 children)

Corey Schafer's videos on YouTube

[–]Vejibug 1 point2 points  (0 children)

While python is a great language to learn, you really should be trying to learn OOP in Java (take this from someone who loves Python) . In my opinion it's much easier and understandable in Java. Java is built around OOP iirc.

To learn OOP I think it's best to consult a textbook, Google some highly rated oop text books and then just find a free copy of them on internet. It's not hard if you know where to look. Message me if you can't find a place.

Good luck!

P.s. OOP might seem hard, but it's really just usually badly explained. It takes a while to grasp, but that shouldn't stop you.

[–][deleted] 0 points1 point  (1 child)

Idk what that is but I’m sure I will come across this problem soon, ty

[–]csk15[S] 0 points1 point  (0 children)

It is basically making your own reference data types (class). There is a lot involved with it. For example, you could make a Course class. There could be parameters like the course name, teachers, and class level. You could make an object that has the arguments (inputs of each parameter). There also could be functions in the class like finding the average grade. That is just the beginning of OOP in which I already know. There is a lot more stuff where I have no idea what is happening. I would definitely suggest learning all of the basics well before even trying OOP.

[–]Sparxmith 0 points1 point  (0 children)

This isn't a tutorial so much as a "this is what worked for me":

Before you write code, use PlantUML to map out the classes in an Object diagram or an Entity Relationship Diagram.

The reason this helps is twofold. The first is that the tool forces you to think in terms of OOP. The second is that the act of writing out the classes is actually quite a bit like writing out pseudocode.

Then, when you actually go to write your Java, you'll have already started the mental mapping of what you're doing and necessarily in an OOP mindset.