A
A
Artem Dilon2020-11-07 13:27:50
OOP
Artem Dilon, 2020-11-07 13:27:50

How to start understanding OOP and programming in this style?

I recently started learning C# (not my first language).
To be honest, I have no idea how to start writing code in the OOP style, because I'm used to regular procedural programming.
How can I understand OOP? I mean, I know what classes are, constructors, destructors, inheritance, polymorphism, private, public and so on. The problem is not in learning object-oriented programming, but specifically in understanding it, in my head the code is formed only in procedural form ...

Answer the question

In order to leave comments, you need to log in

8 answer(s)
D
Developer, 2020-11-07
@samodum

First of all, you need to read books about OOP, especially the first chapters, which describe why OOP is needed at all.
What OOP books have you read?
I foresee the answer - none.

A
Antonio Solo, 2020-11-07
@solotony

only to invent and write programs, there is hardly any other way.
ps As for me, it's much easier to think like "objects" than "data". but I knew people who, in 30 years of working as a programmer, could not accept OOP and their code still remained procedural, although they seemed to use classes.

S
Sergey Gornostaev, 2020-11-07
@sergey-gornostaev

It is necessary to run into those problems for the solution of which the OOP was invented.

A
Alexander Ananiev, 2020-11-07
@SaNNy32

The most effective way is to join an OOP-style open source project. Or get a job as a developer (trainee) in a commercial firm where such projects are being developed.

S
Sanes, 2020-11-08
@Sanes

There is nothing to understand. Literally at the introduction of any course, this is explained.

E
Evgeny Salnikov, 2020-11-08
@kroobeet

code.mu explains many PLs very well. I started studying here myself. Thanks to this site I learned a lot. For example, PHP and its fv Laravel.
You can get acquainted with JavaScript, React, NodeJS, Vue, AJAX, Parsing.
Try to write an MVC framework from PHP lessons there. Well, go through the OOP again

X
xfg, 2020-11-08
@xfg

Explore layered architecture.
Book: Implementing domain-driven design
You can start right away by reading chapter 4 "Architecture" and the subsection "Layers" for a general understanding of what layers exist and why. Further, you can delve into each of the layers in more detail for a detailed understanding of how each of them works.
Examples from the book: https://github.com/VaughnVernon/IDDD_Samples

V
voproser45654, 2022-03-09
@voproser45654

Maybe I'm too late, but I'll try to explain in a simple way.
Classes can be thought of as folders that contain files, and each file has specific actions.
Methods (functions within classes) take arguments (variables within functions) and perform actions on them. OOP is needed to create objects, this is implemented using class inheritance, for example: The kot class in which the izdat_zvuk method with the zvuk argument. We will pass the string "myau" to the zvuk argument to the first cat, and "mur" to the second one, both cats will inherit the kot class.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question