Tester supporting MG4 scripts and advisors - page 5

 
Integer:
In this vein, C++ is the same as JavaScript. And it is true!

A magnificent lie!

Give an example of a C++ implementation of a function similar to Javascript's eval():

01      var str = "if (a) { 1+1 } else { 1+2 }"
02      var a = true
03      var b = eval(str)
04      alert("b равно : " + b) // 2
05       
06      // теперь поменяем "a"
07       
08      a = false
09      b = eval(str)
10      alert("b равно : " + b) // 3

That is, write a piece of C++ source code to a variable of type std::string, and then call the eval() function, which will execute that piece of code taken from the variable of type std::string.

Suggest an implementation of such a function eval() in C++ (i.e. I'm not even speaking about the absence of such a function, but about the possibility of such a function in the language itself).

Needless to say that this is not the only difference.

The MQL4++ core does not differ from that of MQL5: the same syntax, the same types, operations, objects, polymorphism, overloading...

The only difference is the library that implements the API of Expert Advisors, indicators and scripts. In this sense, in the same Javascript, there's a core language and two object models:

Structurally, JavaScript can be represented as a union of three clearly distinguishable parts:

  • kernel (ECMAScript),
  • Browser Object Model (BOM),
  • Document Object Model (Document Object Model or DOM).

And MQL can be represented as clearly distinguishable things: the core language and libraries. If the MQL4 core is different from the MQL4++ core, the MQL4++ core does not differ from the MQL5 core.

So, Renat is absolutely right here, and it's strange to argue with that.

 
Integer:

Exactly. Especially taking advantage of the authority of one's superior position.

All languages are the same, except for the particularly extravagant ones. All of them can be learned in 21 days by any dummy. All have for, while, if, switch, maybe the form of writing is different, but in principle it does not change anything.

Naturally, such a superficial understanding makes it impossible to see the difference. That's why they all seem to be the same.

I would like to play with the eval() function not only in C++ but in MQL4++ as well.

Would you write such a function at least in MQL4++, since there's no built-in one?

I won't be able to write it - the differences between Javascript and MQL4++ are too much for me.

You're saying that all languages are the same, and therefore Javascript and MQL4++ are one and the same, so it must be quite easy for you to write it.

 
Renat:

Instead we switched to very economical CopyXXX functions, where developer exactly queries local array for as much data as he needs, not the whole available graph. Next comes the fastest possible handling of local data (instead of the old rather expensive Open/High/Low/Close/Time[xxx]), plus the author can cache that data and use it sparingly on the next call. The memory and CPU savings are enormous. Additionally, the platform itself is particularly hands free to manage vast databases - access to them is always on demand (instead of unsupervised direct access) and this allows for flexible management of caches.

It should also be noted that the simplicity of Open/High/Low/Close/Time[xxx] calls in MQL4 was limited to the current symbol and timeframe, and all other data for other symbols and timeframes was obtained using iClose/iLow(...) functions, which caused serious delays. The transition in MQL5 to a single CopyXXX function model has radically improved the situation, allowing developers to obtain the required data chunks in one request, and not to make multiple blocked calls (think about the locks in each single call to iClose).

These aren't our functions and neither is this article. This article is a set of monstrous crutches, but was released to show the difference.

I have repeatedly explained the need to use the new features of MQL5, not the horrendous crutches.

If there were a documentation with a sufficient number of examples attached, based on the literate use of new features of MQL5, so that even newbies could assemble their code like dice, without going into all the details, and the code would still be literate in general, thanks to the sufficient number of examples and the examples code written with the literate use of new features of MQL5, the situation with MT5 would not be so bad.

However, as soon as instead of it, there were articles with "a bunch of awful crutches" used as the code, we've got both the rejected MT5 and such an attitude to the API in MQL5. And the overwhelming majority of the audience are not professional programmers. Of course, this is not the only reason for the rejection of the MT5, but it's one of the main ones.

 

Someone was asked:

- Why is it that if, say, aliens exist, they don't talk to us, don't teach us?

He was told:

- Would you teach cockroaches to talk? Why don't you do that?


Simpleton, No offence, you didn't understand a damn thingInteger said.
 
simpleton:

If only there were a documentation with a sufficient number of examples attached, which were written based on the competent use of new features of MQL5,

MQL5 documentation is 4000 pages long in 9 languages, a huge kodobase in source code, 360 articles translated into 5 languages, forums in 5 languages, where you can ask questions, etc.

 
rustein:

Simpleton, No offence, you didn't understand a fucking thingInteger said.

He got it right.

Reshetov said it even more accurately: https://www.mql5.com/ru/forum/153749/page4#998584

In general, the attacks on MT5 are just rotten excuses for those who don't want to switch to a new terminal or inventions by those who have only heard about MT5 but don't know where it is.

 
Renat:

He's got it right.

Generally speaking, the attacks on MT5 are just rotten excuses by those who don't want to switch to a new terminal, or fabrications by those who have only heard of MT5 but don't know where it is.


What does MT5 have to do with it?
I want to do it for a long time. But the broker does not offer MT5 yet. So promote it properly.
As for who understood what or not, maybe you do not understand. Is it so important?
 
rustein:

As for who understood what or not, maybe you didn't either. Is that so important?

You haven't uttered a single meaningful sentence or made a single argument. Just emotion.

 
Renat:

You have not uttered a single meaningful phrase or made a single argument. Only emotion.

И?
 
simpleton:

...

There was a discussion somewhere here recently about what programming language to learn. One participant gave a very useful recommendation - first Russian (or any other, native language). To understand what the conversation is about.

In the sentence"In this vein, C++ is no different from JavaScript. " the phrase"In this way" defines (or clarifies) the criterion of comparison. So a strange question arises - "What are you talking about here now?"

Reason: