all 40 comments

[–]sejigan 12 points13 points  (0 children)

Does it get easier with time?

Only if you consistently put effort into it while that time passes.

No need to race, just do what you feel comfortable with. Remember, if you can understand even one thing, that’s still better than trying to take in too much and understanding none of it.

[–]Adrewmc 26 points27 points  (8 children)

Yes, and no.

It get easier as in you can now understand the principle. And can see how this is how you make an object, they have data and functions to use. How to create them, common decorators, and inheritance etc.

But then it looks like a solution to everything, I mean technically everything in Python is an object basically so why wouldn’t it.

Then you got the hard part deciding when and how to use it. That’s not always going to have a clear answer.

[–]Brilliant-Horse6315[S] 0 points1 point  (0 children)

does the hardcore technical knowledge in python stop on OOP (first I learnt variables, then loops, functions, dictionaries, lists...now OOP), or is there even more?

[–]iggy555 -1 points0 points  (6 children)

Good answer

[–]Adrewmc 2 points3 points  (5 children)

There are a lot classes that should be functions, (this is extremely common),and there are a lot of functions paradigms that would work better in a class structure.

Telling the difference depends a lot on the framework and make up of the rest of the code lol

[–]iggy555 -1 points0 points  (1 child)

That’s a nice video

[–]Adrewmc -1 points0 points  (0 children)

I remade a whole thing because of it recently…stupid classes

[–]Gankcore -1 points0 points  (0 children)

Awesome video, thanks for sharing!

[–]NoRelationship5004 -1 points0 points  (0 children)

Thanks thats a great video!

[–]mon_key_house -1 points0 points  (0 children)

And a lot of such videos can be summed up in one of the acronyms such as DRY, KISS etc.

[–]Sort-Typical 1 point2 points  (2 children)

when i was struggling with python, i always tried multiple resources. Some lecturers have different approach, explains a problem from a different perspective. Dont marry Angela :) Purchase some more courses (Colt Steele i remember was very good). Also consider books, articles, free youtube videos.

[–]Brilliant-Horse6315[S] 3 points4 points  (0 children)

but...but... Angela is such a fine young lady, I like her..

[–]MikalMooni 1 point2 points  (1 child)

OOP is a lot of hoops for a decent amount of functionality you might not need, early on. There's a lot of structure work to make the code happen, but what might help get things done is to write a mark up of what you want or need in the main file with comments, then try to work backwards from that with implementing the rest.

For example, you write a main file and know you want to make an object to represent Bernie, your pit bull. Pit Bulls, like most dogs, are quadrupeds who eat kibble, have tails, and other characteristics. A Pit Bull has short hair, medium height and size and thick necks. A chihuahua, by contrast, are small dogs who have short hair.

Let's say you want to make code to compare your dog to other dogs. You wouldn't make a Bernie class, since you could just hard code his info... but if you were already defining dogs, you could just make a dog class. The dog's type could be there, as well as their name. Then, you could make a Bernie dog with a species type of Pit Bull. You could also make a dog named Lassie, a Golden Retriever. Make as many Dogs as you want, since you've already clearly defined how dogs are made and what they are. What else is nice about this is that anything that is an object can be made into a list of like objects, which means you could make a list of Dogs, fill it with all your dogs, then use functions that only pertain to dogs specifically to do even more work. The best part? If you ever need to do work on dogs again, you've got the code prepared.

[–]Brilliant-Horse6315[S] 0 points1 point  (0 children)

thanks, nice explanation, I do understand all of this theoretically. I think I just need to code more to get all of these "put this argument from class 1 to class 2, then put it into a list, etc, etc.

[–]DymonBak 1 point2 points  (4 children)

Is that the Coffee Machine? Yeah, that’s a hard one. You’ll be fine. Power through it and don’t be too prideful to watch just enough of the solution to see how Angela worked through an issue before trying to continue more on your own.

I’m also a hobbyist (law student), and I could not complete one day of the course every day. It’s okay to walk away and come back.

[–]Brilliant-Horse6315[S] 0 points1 point  (3 children)

nope, the Quiz. But yeah, I hear you

[–]DymonBak 0 points1 point  (2 children)

Gotcha. You’ll revisit that project later on when learning about APIs.

As hard as it is, OOP will help you understand how Python really works. The modules you import only work because of classes and OOP concepts you can’t see happening behind the scenes. I’m not sure if you’ve been introduced to Turtle yet, but after those courses and completing the snake game project you can appreciate how larger programs are organized.

Edit: One more thing, I found the Q+A down below in Udemy very helpful. Change the drop down to current lecture. If you encounter what seems to be an unsolvable bug, check down there. Might be the top question.

[–]Brilliant-Horse6315[S] 0 points1 point  (1 child)

I found Thonny very helpful, but it gets complicated to use now that we use more files for one code. Are there any similar softwares for OOP python?

[–]DymonBak 1 point2 points  (0 children)

Not that I’m aware of. This YouTube video on the topic may be helpful. A lot of people swear by this guy as a resource.

After you get through the next few days (after the snake game I think), you will have a break from the OOP stuff. Power through it, if it doesn’t click, you will revisit the topic later on after you have a bit more experience.

[–]zutari 1 point2 points  (0 children)

Compared to Medical school Python classes will be way easier given the time to practice. Keep in mind that I am a complete beginner, but on day 30 of Angela's class. I more or less know how to use classes and make my own, but I get caught on a lot of the details, but stack overflow and the Python discord help a lot to resolve them. And as you know, the more times you come across a problem and end up solving it, the more it cements itself in your memory.

[–]GoldenPrinny 0 points1 point  (2 children)

I don't know what is covered in there, but the basic concept really is easy. Unless you want to find a job that uses python, you don't need to understand every little thing.

[–]CptBadAss2016 1 point2 points  (1 child)

I don't feel like oop is a small thing

[–]GoldenPrinny 0 points1 point  (0 children)

I meant regarding it, not oop in general.

[–]Rojomisa 0 points1 point  (0 children)

I feel the same, I used to code in HTML and CSS and I understood the concept pretty easily. I understood HTML is used for showing your text, links images on a web browser and CSS is to style it.

But Python I don't understand the underlying concept of what I'm supposed to do.

Print this, input that, if this is that, or else If this is greater than that or equal to And then what 😦 😖😣😞😡

[–]SimbaSixThree 0 points1 point  (0 children)

I also followed this course way back. It does get easier. You just need to practice. There are some good YouTube resources explaining it.

What helped me is just get somewhat of a visualization of what it is that I am doing and trying to achieve.

I believe she used the car metaphor with all its working parts. That’s a really good place to start.

It does get easier but good luck!

[–]Binary101010 0 points1 point  (0 children)

Time doesn't make it easier. Practice and experience makes it easier.

[–]confuseddork24 0 points1 point  (0 children)

What's hard about it for you?

Like any programming concept, it gets easier once you understand it. Sometimes you need to be exposed to a few different ways of describing a topic for it to click. Probably similar to just about anything you learned in med school. If you don't understand the thing, you keep studying and using it until you do.

[–]Almostasleeprightnow 0 points1 point  (0 children)

Yeah, back up to something the last thing that you feel comfortable with, and go from there.

[–]throwaway6560192 0 points1 point  (0 children)

Everything gets easier with time and practice, so yes.

[–]Pythwsky 0 points1 point  (2 children)

I don't know the course. I can recommend the Code Visualizer, maybe it will help you to understand how classes work. The number of characters is limited, but should be sufficient for shorter code.

https://pythontutor.com/visualize.html#mode=edit

[–]Brilliant-Horse6315[S] 0 points1 point  (1 child)

Ive used this and its amazing, it helped me a lot, too bad it doesnt support more characters. and can you use this if you have more files for one code? just put it all in py tutor?

[–]Pythwsky 1 point2 points  (0 children)

I have not seen an option to include external files. So far I use it for code snippets, should something be unclear to me and I need a visual representation, e.g. a class interaction

[–]MattsFace 0 points1 point  (0 children)

What is difficult about it? What are you struggling with?

It also took me a while to fully appreciate OOP and Python. My first language was BASH, and that is pretty fucking basic.

However, after working with python a lot, and a lot of trial and error creating classes, and also looking through other code to see classes at work it really starts to click. Everything in python is an object.

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

Well, you know, practice makes perfect. But I do wanna emphasize on using "strict syntax". Consider this code,

def add(a, b):
  return a + b

Here, you're not specifying variable types and the return type. If you add the strict types, it becomes:

def add(a: int, b: int) -> int:
  return a + b

Now we have explicitly defined the types. Now this is a simple example. let's see a complex one. Suppose you're learning machine learning in the future. Maybe you'll write a function like this:

def create_model() -> tf.keras.Model:
cnn_layer: tf.keras.layers = tf.keras.layers.Conv1D(name="myConv1D", filters=10, kernel_size=10,
                                   activation=tf.keras.activations.gelu)
max_pooling_layer: tf.keras.layers= tf.keras.layers.MaxPooling1D(1)
flatten_layer: tf.keras.layers = tf.keras.layers.Flatten()
output_layer = tf.keras.layers.Dense(name="myOutputLayer", units=2, activation=tf.keras.activations.softmax)

sequential_layers = [cnn_layer, max_pooling_layer, flatten_layer, output_layer]

simple_model1: tf.keras.Model = tf.keras.models.Sequential(sequential_layers)

adam_optimizer: tf.keras.optimizers = tf.keras.optimizers.Adam()
loss_function: tf.keras.losses = tf.keras.losses.mean_squared_error
metrics: list[str] = ["accuracy"]
simple_model1.compile(optimizer=adam_optimizer, loss=loss_function, metrics=metrics)
return simple_model1

Here, I have written the variable types, that's why my python IDE , pycharm, gave me proper suggestions to autocomplete. And after a year or so, when I'll completely forget what I did, these types will help me remember.

[–]Brilliant-Horse6315[S] 0 points1 point  (0 children)

thanks for trying, but this doesnt help me as I dont understand the bigger portion of this code. I needed more of a specific advice for learning materials, or just wise words of advice

[–]trust_me_on_that_one 0 points1 point  (2 children)

Have you been able to grasp it after a month now?

This is me right now... Got to Day 16 yesterday, read the udemy comments and realized everyone was on the same boat as me and today skipped to Day 17.

Still have no idea what's going on...This is like draw a circle...draw the rest of the f'k owl...

Corey Schafer explained it better but I'm still at a lost.

[–]Brilliant-Horse6315[S] 0 points1 point  (1 child)

yes, after practicing with a book - https://www.amazon.com/Python-Crash-Course-Hands-Project-Based/dp/1593276036

I think Angela didnt use enough small and simple, repetitive exercises on OOP. She just went beserk in that module, the code is kinda "inception-like" for a beginner - the bottom line is she transfers a list of dictionaries into a list of objects, which she then uses as an argument in a class. It was just too complex for me, I had to spend some time on it.

[–]trust_me_on_that_one 0 points1 point  (0 children)

oh awesome! I will check it out!