Questions on OOP in MQL5 - page 47

 
Igor Makanu:

MT developers always write that using built-in compiler mechanisms will be faster than calling even regular functions

If you have time and interest, check the speed of my version and your own with ArrayCopy

I'll check the speed a bit later, I'm busy with my PC lessons right now.

I was wrong about ArrayCopy, because you have an array of arrays, it won't copy. You have to copy it element by element, so yes, your way is optimal.
 
Alexey Navoykov:
I overdid it about ArrayCopy, you have an array of arrays, it won't copy. You have to copy them element by element. So, yes, your way is better.

Phew... at least something cleared up ))))


Although there is a common opinion that MQL is a C-like language, but imho it's closer to Sharp than Plus.

I copied almost 99% of code in MQL. It's a 5-10 min. job

ZS: I would do it, but I think I have this code on my laptop - I can't remember, I need to look for it, and at home I have no computing power ... it's a mess in general ))))

 
Igor Makanu:

Phew... at least something cleared up ))))


Although there is a common opinion that MQL is a C-like language, but imho it's closer to Sharp than Plus.

I copied almost 99% of code in MQL. It's a 5-10 min. job

ZS: I would do it, but I think I have this code on my laptop - I can't remember, I need to look for it, and at home I have no computing power ... it's a mess in general ))))

It's as far from the pros as the moon and as far from Sharp as the orbit of Pluto. In general, the general impression is that everything is done in the WinApi image. And yes, the pluses are still the basis.

 
Vladimir Simakov:

It's as close to pluses as to the moon, and Sharpe is as close to Pluto's orbit. In general, the impression is that everything is done in the WinApi image. And yes, the pluses are still the basis.

There's plenty to argue about, but you've already dealt with STL porting problems, haven't you ?

to speed up the process of arguing.... Take away STL and then the pointer handling, and you will NOT get MQL capabilities in the output.

but if you apply the same "take away mine" to C# , then what's left of Sharp might look like MQL-like in its possibilities

;)

 
Igor Makanu:

There's plenty to argue about, but you've already dealt with STL porting problems, haven't you ?

to speed up the process of arguing.... Take away STL and then the pointer handling, and you will NOT get MQL capabilities in the output.

but if you apply the same "take away mine" to C# , then what's left of Sharp might look like MQL-like in its possibilities

;)

If you remove pointers from C, you won't have C either, while stl is just a library))))

And what do you suggest to take out of Sharpe, objects?) It will have the same effect.

By the way, templates in mql are still templates from C, not generic from C# (compile time). And there are no macros in Sharp).

 
Vladimir Simakov:

If you remove pointers from C, then there will be no C, and stl is just a library.)

And what do you suggest we remove from Sharp, objects?) It will have the same effect.

By the way, the templates in mql are still templates from C, not generic from C# (compile time). And there are no macros in Sharpe).

I do not think it is worth wasting time and effort arguing withIgor Makanu,
The man is trying to argue about high level senior matters without understandingtrivial trainee level issues.


 
Igor Makanu:

There's plenty to argue about, but you've already dealt with STL porting problems, haven't you ?

to speed up the process of arguing.... Take away STL and then the pointer handling, and you will NOT get MQL capabilities in the output.

but if you apply the same "take away mine" to C# , then what's left of Sharp might look like MQL-like in its possibilities

;)

STL is just a library. Using or not using it does not influence the possibilities of the language, they will be 2 heads higher than MQL as before.

And Sharp is similar to MQL only in arrays. All the rest MQL reminds of C++, maybe from '99 or earlier.

 
Sergey Dzyublik:

I don't think I need to waste my time and energy arguing withIgor Makanu,
A person is trying to argue about high level stuff without understandingtrivial questions of trainee level.

Don't argue, don't waste your time, it's not like I wrote in theSergey Dzyublik- reply! ;)

Have you seen the thread title? - My questions correspond to this thread? - Well, no one assigned me the task of pleasing your Ego today))))

Vladimir Simakov:

If you take pointers out of C, you'll have no C at all, while stl is just a library))))

I understand it, but high-level languages are interesting with ready-made solutions, or we would be busy writing printf() for half a day now)))

Alexey Navoykov:

And Sharp is similar to MQL only in arrays. All the rest MQL reminds of C++, maybe from '99 or earlier.

You may be right on the money.

 
Igor Makanu:

There is much to argue about, but you have already encountered problems with STL porting, haven't you?

The main problems I encountered in porting std::vector from C++ to MQL:
1)bugs(and not all here either).
2) Standard functions work adequately only for certain data types (I have to manually write universal ArrayCopy, ArrayFill with support of conditional compilation, depending on type, for maximum speed);
3) Standard functions work slowly enough for certain types of data (you have to manually prescribe ArrayResize for quick Resize+Reserve for simple data types);
4) And only the fourth place lack of functionality - lack of "typedef declaration" (it is circumvented through #define, inheritance of classes and structures, use of wrapper classes for simple types).


 
The main thing is that it's supposed to be higher-level than C++, and the code in it should be simpler and more laconic. But in fact it's vice versa. The code in MQL is much more cumbersome and clumsy. You have to crunch a lot of things.