A question for OOP experts. - page 7

 
That's it, I'm off to learn OOP. I'll reply to everyone when I come back).
 
Nikolai Semko:

Don't spare 45 minutes, Peter. At the outset, it is very important to understand what this fellow is talking about. Many will probably argue with him, but in general he is right:


An interesting lecture, but too many questions remain. He talks about detrimental effect of setters and getters but explain me, what's the difference, if I introduce errors in setters or in constructor? So it turns out that SB MQL5 is just one big mistake? There are a lot of all these setters and getters, aren't there?

 
Alexey Viktorov:

Interesting lecture, but there are too many questions left. Here he is talking about the harm of setters and getters, but please explain to me, what's the difference, where you make mistakes, when entering some values through setters or in constructor? So it turns out that SB MQL5 is just one big mistake? There's a lot of all these setters and getters, isn't there?

also looked at these 45 minutes yesterday.... well, it's like even the students have smashed the author to pieces.

The theory says it nicely: here's the object, it must be able to do everything - and it shouldn't be tied to hardware because you command the PC, not you! If the object doesn't know how to do something, we write another small class, in practice this is not the case - if you refuse to control an object, there will be blocks of repetitive code, inheritance will partially solve this problem, but in general, instead of solving the problem, the programmer gets a bunch of objects (or a mountain of pain? )))) and will have to figure out how to manage it all ...... imho, if IT giants wrote code similar in logic, it works, and innovators, well, they have always been and will be, but their results, for some reason, are not visible.

SZS: how to change the colour of the button? - kill the previous object and create a new button of a different colour? - and how do you get button status? - and if it's a colour scheme of hundreds of buttons - again kill them all and create others? ;)

 
Igor Makanu:

also watched this 45 minutes yesterday.... well even the students sort of smashed the author.

The theory says it nicely: here's the object, it must be able to do everything - and all this should not be tied to the hardware because you command the PC, not the PC command you! If the object doesn't know how to do something, we write another small class, in practice this is not the case - if you refuse to control an object, there will be blocks of repetitive code, inheritance will partially solve this problem, but in general, instead of solving the problem, the programmer gets a bunch of objects (or a mountain of pain? )))) and will have to figure out how to manage it all ...... imho, if IT giants wrote code similar in logic, it works, and innovators, well, they have always been and will be, but their results, for some reason, are not visible.

SZS: how to change the colour of the button? - kill the previous object and create a new button of a different colour? - and how do you get button status? - and if it's a colour scheme of hundreds of buttons - kill them all again and create others? ;)

The funny thing is that even theunconscious application of OOP principles brings quite tangible results!

 
Alexey Viktorov:

Interesting lecture, but there are too many questions left. Here he is talking about the harm of setters and getters, but please explain to me, what's the difference, where you make mistakes, when entering some values through setters or in constructor? So it turns out that SB MQL5 is just one big mistake? There's a lot of all these setters and getters.

The developers have done everything correctly - the Standard Library is focused on the entry level, and for most tasks it is quite sufficient. To write in OOP (and not only juggle with terms) one needs an advanced level and certain type of thinking. If you don't have it, you can stillturn everything into classes thinking that this is OOP. It probably cannot be taught - understanding comes with time.

 
A100:

If you don't have it, you can still wrap everything in classes, thinking that this is OOP.

Once again you're trying to show off your cleverness, but unfortunately you don't show your examples, and again you're trying to think up something for people you don't know, to say, to...

imho, petty, nasty, trying to be nasty - in general, don't get distracted ))))

 
Igor Makanu:

Once again you are trying to show off your intelligence, but unfortunately you don't show examples of it, and again you are trying to make up things for people you don't know, to...

imho, petty, nasty, trying to be mean - in general, don't get distracted ))))

I'm showing the wrong examples - thereby giving a fishing rod, but not a fish.

 
A100:

I show wrong examples - thereby giving a fishing rod but not a fish.

What's wrong? the examples work in the tester and in trading

i have repeatedly written that if it is convenient, it means it may and should be used

To deploy inheritance for simple strategies, of which every trader on the Runet forums tries to invent a dozen or so every week, in most cases makes no sense, while my examples allow to provide a quick portability of the ready code.

If you have a specific question or suggestion, maybe I would like to discuss it, if not, what's the point of discussing something that is not there?

 
Igor Makanu:

what is the error? the examples work in both tester and trade

The error is from the point of view of OOP, not from the point of view of the final result. If you do not understand what the error is, rewatch the video again, and then again and again - until you get an understanding. This is the first time I've seen this video myself, but I couldn't explain it so simply and understandably

 
A100:

An error in terms of OOP, not in terms of the end result. If you do not understand what the error is, watch the video again, then again and again - until the understanding comes

Alas, it will not, the speaker could not even answer the students' questions, the questions were correct.

Let's get down to practicalities.

I suspect that you support the author of the video, his name is Egor (it is written so), the main message of the video was to go completely into OOP - the real OOP!

OK! give a simple example of how to use OOP as suggested by the author, the task is simple, he himself mentioned the work with files and he himself could not answer the question of students

I use the CFile class quite regularly - I'm too lazy to write extra code and am used to using ready-made code, it solves my problems well

What in CFile, in your opinion, should be rewritten based on what the author of the video said?

Reason: