N
N
nluparev2015-03-23 14:20:19
Python
nluparev, 2015-03-23 14:20:19

Advice for a beginner programmer. How should one approach acquiring an OOP skill?

Hello.
I am a beginner programmer. At the moment I'm doing a specialization on the course "Fundamentals of Computing Specialization".
Now I'm going through the 1st part https://www.coursera.org/course/interactivepython1 in which we make games not big <= 300 LOC.
Here's the last one I made myself: www.codeskulptor.org/#user39_jGpMRtLwMIR87yo.py
From start to finish, this is my project. The idea and the project, I did everything myself.
My knowledge of OOP is very small, I read a couple of tutorials on the Internet and tried to do it as well as I can.
While I was doing this project, it became clear to me that the appeal of one part of the program to another can create a kind of dependency, making the entire program as a whole less flexible and making changes to it becomes harder.
It became clear that OO style programming is a skill that needs development and practice.
Using your experience, tell me how to properly approach the study of OOP?
To be clear, I'm not looking for "how to learn fast" answers. I'm currently studying, so I have a lot of free time and I wanted to devote it to developing my skills. I am used to work diligently and conscientiously, so I am ready to work hard.
I plan to further develop in Python, it would be great to see resources with examples in this language. But, if you think that there is a certain book that should be read even if it is in C ++, write.
I don't run from work. If you need a book to read, write. To work on some project where these principles are well shown, write.
I speak and read English fluently. If you know good material in English, write.
Thank you very much for any tips and advice.

Answer the question

In order to leave comments, you need to log in

11 answer(s)
V
veitmen, 2015-04-02
@veitmen

I read the answers.
I can only advise to further develop object thinking. Yes, books are good. In them, you will begin to understand how to use OOP tools and what they are for. But you will learn how to design your types only after you clearly begin to use object thinking. Try walking down the street to look at what surrounds you. And think about how to shift any surrounding object to the code. How to make it so that it would be easier to create these objects with a minimum amount of code (learn how to use inheritance and polymorphism). Why something from the implementation needs to be hidden from the user (encapsulation). Start thinking about how you can create a class hierarchy for non-material things (processes, connections, feelings). When you look at the task (I emphasize that the task is any), you will see what objects you need and how they interact,
OOP is just another tool, don't think it's a golden bullet. The state, in general, is evil.

A
Alexey Cheremisin, 2015-03-23
@leahch

Well, for starters, read the design patterns, they were originally traced for Java, some do not directly relate to python (due to the fact that in python you can do without classes at all, and you can do it in the style of functional programming), but they give a good base in OOP . On the other hand, if in Java the design is OOP, then sometimes you don’t want to start a class in python, but you write in the style of functionality.
Probably the first thing to do is to study scopes and dream about how they can come in handy...

V
Vitaly Vitrenko, 2015-03-23
@Vestail

Good overview of books on design and OOP

T
thepry, 2015-03-23
@thepry

https://www.coursera.org/course/interactivepython1

I want to say that this is just a great course. For many years, programming seemed too complicated and incomprehensible to me. But a few years ago, I stumbled upon this particular course while doing all sorts of pongs and blackjacks and it all spun.
Great course choice!

F
FoxInSox, 2015-03-24
@FoxInSox

Sitting on a chair. Start doing something now.

F
Fedor Kichatov, 2015-03-28
@sozforex

An introductory (but not elementary) programming course that provides a smooth transition from functional programming to OOP, explains the benefits of OOP, why OOP was invented and how to use it:
www-inst.eecs.berkeley.edu/~cs61a/fa14
I received a lot of valuable knowledge while taking this course, although I worked as a programmer for 2 years before that.
The course comes with a Python-adapted SICP (Structure and Interpretation of Computer Programs) book with built-in interactive goodies.
Chapter 2 of this book is devoted to OOP and the foundations on which it is built. I recommend not to jump over the beginning of the course/book.

V
Vladisus, 2015-03-23
@Vladisus

I would suggest Python3 Object Oriented Programming (Dusty Phillips), a good book. And of course, practice, solve all problems using OOP ...
Also go to codewars and find OOP problems there, there are few of them in python and they are easy, so look at the condition from problems in other languages ​​​​and solve in python

I
Ivan, 2015-03-23
@sputnic

Start with: "Gradi Booch: Object-Oriented Analysis and Design"

J
jaxel, 2015-03-24
@jaxel

Freeman Er., Freeman El., Sierra K., Bates B. "Design Patterns" (2011) - Very good for beginners. I would recommend starting with her.

D
Denis Shchetinin, 2015-04-02
@chaetal

Offhand approximate The correct way of the OOP padawan:
1. Learn Smalltalk - only here is the correct (simple and complete) object programming. First, you can look at articles on smalltalk.ru to form a general idea of ​​​​the philosophy of Smalltalk (this is the key point), google articles on the topic Why Smalltalk ... But the main thing is practice, go to pharo.org for it. For help, you can contact the Russian Smalltalk User Group: https://groups.google.com/forum/#!forum/sugr
2. When you get comfortable, you can read Beck's Smalltalk Best Practice Patterns [ http://stephane.ducasse.free .fr/FreeBooks/BestSmal... are important and non-obvious nuances of programming in Smalltalk.
3. From this book (even from the introduction to it), you can smoothly move on to studying TDD - first the classics on Test-Driven Development by Example by the same Beck, then through Growing Object-Oriented Software Guided by Tests to the all-consuming TDD (BDD). Both books can be found in PDF form for free.
Somewhere in the interval after the beginning of the first and the end of the third paragraph, enlightenment should come. The path is not fast.
Warning : after enlightenment, most "object-oriented" languages ​​and books on the subject will cause a gag reflex.

J
Jaropolk, 2015-04-14
@Jaropolk

As you correctly noted, programs and its blocks have dependencies among themselves. Good code minimizes dependencies between blocks, and makes relationships clear and obvious.
In order to write such code, first of all, experience is needed.
Therefore, programming in OOP is not just a set of knowledge - it is an art. And in this case, experience and flair are needed (although this is the same experience).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question