I
I
Ilya Parshakov2018-01-13 11:24:46
PHP
Ilya Parshakov, 2018-01-13 11:24:46

How to get into programming (OOP, patterns)?

Hello. I have been programming in PHP for about 2-3 years, I got to the Laravel framework (I figured out controllers, REST routes, ORM models ...), took several courses on it, figured out GIT and Composer. But I understand that there is still a lack of understanding of the basics of programming, I don’t know how best to express this feeling :)
I would like to ask you to suggest what is better to read, watch in order to understand the essence of OOP, understand object-oriented thinking, understand design patterns their implementation.
For example, I learned how to use Dependency Injection in the controller's constructor, but I don't understand how it works and what it's for.
Please help! Who than can :)
Thank you in advance for your advice and your time.

Answer the question

In order to leave comments, you need to log in

10 answer(s)
G
GTRxShock, 2018-01-13
@parschakov

if you have been programming in php for 2-3 years, then it would be time to read PHP before going to bed: objects, patterns and programming techniques (Zandstra), preferably in paper form.
+ Design patterns (Freeman) for a general/visual understanding of patterns
+ www.phptherightway.com key points
+ Refactoring: improving the design of existing code (Fowler) & https://refactoring.guru/ru for the future, something to strive for :)

A
Antonio Solo, 2018-01-13
@solotony

the problem of understanding OOP by 90% is in bad translations that are done by who the hell knows who and who the hell knows how. often people generally have little understanding of what they are writing (translating) about, or they have problems with the language of presentation.
or the authors suffer uncontrollable bouts of graphomania.
for some reason, it seems to me that all OOP can be outlined schematically on 3 notebook sheets
. I myself studied OOP in C ++ (according to stroustrup about 25 years ago), but the paradigms remain the same - inheritance, encapsulation, polymorphism.
and Dependency Injection is just like mooing. "when an object is created (usually when it is created), the objects on which it depends are passed"

K
Kirill Mokevnin, 2018-01-13
@toxicmt

If you want a truly serious fundamental and mature. Then take Benjamin Pierce's book Types in Programming Languages. Get really scared first, then fast forward to the "OOP" chapter.

K
Kir ---, 2018-01-19
@SowingSadness

Here I look at the mountain of advisers and understand that they themselves have not gone far. You need to start studying OOP by answering the questions:
Why was it invented?
What goals does it pursue and what tasks does it solve?
What tools are available to solve these problems?
Everything else is a consequence. As understanding comes, you will understand in which direction to dig. And then you were advised of patterns here. And their stupid study will safely kill a lot of your time with almost no use.

D
Dima Polos, 2018-01-13
@dimovich85

I advise you to watch this video and other videos and playlists on this channel, for free and very clearly: https://youtu.be/zWjT_2hFkMw
Link about objects in js, but the essence of OOP is described as very clear to me. There is material for php too.

D
Dmitrij, 2018-02-09
@Vahmur

Oh, I remember how I tried to enter the OOP with the help of books.
... we create a class of type machine. (c)
But it's useless.
Maybe I'm kinesthetic. But I have everything only with my hands a little bit on real tasks.

V
Vasiliy_M, 2018-01-13
@Vasiliy_M

Link
You just need to learn to think with objects.

N
novrm, 2018-01-13
@novrm

If you started duplicating the same code in a project, then you didn't fully understand OOP and design patterns.
Getting rid of duplication of the same code in a project is the main motivator to look for a solution in OOP and templates.

E
EvGenom, 2018-01-13
@EvGenom

To understand how it works -> Take your code and run it in the IDE with breakpoints.
To understand why this is done -> PHP: objects, patterns and programming techniques + OOP techniques. Design Patterns (ignore 2001, this book is still up to date)

E
Eugene Pedya, 2018-01-18
@fpinger

You need to start with SOLID. Allows you to understand how to write mutable and extensible code with minimal problems. And programming is about changing and expanding code. The patterns will then be easier to apply.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question