PLO - page 6

 
Rosh:
There is no difference as long as you don't explicitly refer to the object by reference as a pointer. Try it yourself and see the article When to use pointers in MQL5
Thank you!
 
Serj_Che:

Please don't kick me, but explain on your fingers what kind of OOP is and how to prepare it.

I hope to hear an answer from MKL5 creators and programmers who asked to make OOP in MKL5.

As far as it speeds up or slows down. On the face of it, MKL5 is a resource eater with no increase in speed as compared to MKL4.

I would like to see concrete examples of performance gains.

OOP allows you to simulate different situations and also parallelize calculations. Tetris is not a very good example, it can be written without OOP, just more code. Try, for example, to create a fishbowl where each fish has its own speed and its own trajectory and there are 500 of them. - For this kind of tasks the OOP is just the right thing! If we take expert advisors in forex, then, for example, an object can be run through the history with certain parameters, while the EA itself will be trading at that time. Or the same graphical panels - toolboxes - for example, several independent data windows. Where parallelism of work and calculations is needed, that is where OOP fits in.

 

OOP has nothing to do with parallelisation.

 
papaklass:
So, the statement "Where parallelism of work and calculations is needed, that's where OOP should be" is not true?

CUDA, for example, is written in simple C, and no OOP is out of the question there.

As far as I know, there are no languages that use OOP directly for paralleling today.

 
papaklass:
So, the statement "Where parallelism of work and calculations is needed, that's where OOP should be" is not true?
Not exactly. When applying OOP you should take into account resource accounting, for example, there are not 500 million fishes but 5 million of them plus seaweeds)). Let's give you an example, for example, you have an Expert Advisor that uses several money management schemes. And you want to see the entire dynamics of the EA working with different money management schemes. If we don't use OOP, we would have to sequentially calculate for each scheme, which may lead to obsolescence of a tick. Or make the execution of each MM scheme in an object. Since there is a reserve of resources, everything would be output almost "the same" - "in parallel". That's the kind of paralleling I had in mind.
 
papaklass:
So, the statement "Where parallelism of work and calculations is needed - that's where OOP fits in" is not true?

Yes. It's not true.

 
Serj_Che:

OOP is a bug, like "Niva" or "Lada".

Use regular procedural programming in MetaTrader 5.

It is as accessible here as it is in MetaTrader 4.

Too bad MetaQuotes doesn't emphasize it.

 
MoneyJinn:

OOP is a bug, like "Niva" or "Lada".

Use regular procedural programming in MetaTrader 5.

It is as accessible here as it is in MetaTrader 4.

Too bad MetaQuotes doesn't emphasize it.


An error, why should they?
 
MoneyJinn:

OOP is a bug, like Niva or Lada.

Use normal procedural programming in MetaTrader 5.

It is as available here as in MetaTrader 4.

It's a pity that MetaQuotes doesn't emphasise it.

In my opinion, you are very much mistaken!

Once you have large projects (at least a few thousands of lines of code), you will see that programming with classes (OOP) makes it very easy to control the process of development and, most importantly, debugging.

Besides, OOP makes projects closer to real life, in fact in real life we deal just with instances of objects (a house, a tree, a man, a car, an order, etc.), i.e. with a set of properties and methods :)

Try to do something in OOP, you will see, that it is more elegant and clear. It is easier than procedural programming!

 

MoneyJinn:

OOP is a bug, like Niva or Lada.

Use normal procedural programming in MetaTrader 5.

It is as available here as in MetaTrader 4.

It is a pity that MetaQuotes do not focus on it.


Until the application of OOP will not bring any practical benefit in the form of money, there will be arguments. I'm not a supporter of arguments. After all, you can read wikipedia and google pros and cons of OOP, parallelization. If you need examples there are a lot of them in the set of terminal programs. Even this set of terminal programs isn't it easier to write programs? Conventional procedural programming is less versatile.

I have several objects, each doing something different - for each to write procedures and wait until they're done in turn - don't bother.

OOP is a bug, like "Niva" or "Lada". - bravely! I wonder how many programs are installed on your computer, including OSs? And what is the ratio of programs which use OOP and those which don't?