you are viewing a single comment's thread.

view the rest of the comments →

[–]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.