What I would like from the "terminal" as a professional programmer. Another thread with wishes for MQL5. - page 6

 
Korey писал (а) >>
about a quarter of numerical algorithms use goto, how about if an algorithm is tried, approved, tested, but it can't be
to MT without goto?

Stuff the functionality in a dll or remove goto.

I'm still wondering what algorithms you're talking about.

 

I join Korey. No one has seen any nifty algorithms implemented with goto? All this goto hysteria is just some kind of religion rather than an actual need. A competent coder can write a clear and accurate code with goto as well and it can be more readable than equivalent code with conditional jumps.

P.S. It seems that Wirth himself, who criticized goto, left it in his brainchild anyway. And in C++, "the most structured of structured" languages, goto seems not to have disappeared. I don't accept the objection of backward compatibility with C.

 
TheXpert писал (а) >>

Actually, using goto is a bad programming style and in 99% of cases code with goto can be replaced with similar code with existing conditional statements.

I disagree.

You can rewrite it. But you can also say that the absence of goto in a language is a bad style and 99% of code can be rewritten based on its use.

I, for example, really missed goto to exit complex nested if-else structures with loops. If somewhere deep in the structure the necessity to exit analysis is calculated, I have to write an additional analysis of exit flags for all these attachments which I find inconvenient. It overloads the code. It's much easier to remember the flag's state and goto outside the analysis.

It doesn't have to pass to the mark. It was already discussed. We could pass it behind an external (named) block (operator, loop - whatever has a body in curly braces).

 

Well, SK. has already written just what I wanted to ask the correct style zealot (e.g. getting out of the depth of a fivefold nested if-else).

 
TheXpert писал (а) >>

Cram the functionality into a dll or remove goto.

I'm still wondering what algorithms you're talking about.

it's about Fortran as the main source of numerical methods.
Everything in it is tested and approved by the american association of engineers.
and there is no problem here - we work with DLL and that's it)))
and as if it does - you want to insert directly into the MQ code, but you have to plough through the algorithm, which is quite time-consuming.

P.S. and most importantly dangerous.

 
Mathemat писал (а) >>

I join Korey. No one has seen any nifty algorithms implemented with goto? All this goto hysteria is just some kind of religion rather than an actual need. A competent coder can write clear and clean code with goto as well and it may be more readable than the equivalent code with conditional jumps.

P.S. It seems that Wirth himself, who criticized goto, left it in his brainchild anyway. And in C++, "the most structured of structured" languages, goto seems not to have disappeared. Objections to

I don't accept backwards compatibility with C.

I'm not going to disagree. That's right.

SK. wrote (a) >>

I disagree.

It is possible to rewrite it. But you could also say that the lack of goto in the language is bad style and 99% of the code can be rewritten based on its use.

I, for example, really missed goto to exit complex nested if-else structures with loops. If somewhere deep in the structure the necessity to exit analysis is calculated, I have to write an additional analysis of exit flags for all these attachments which I find inconvenient. It overloads the code. It's much easier to remember the flag's state and goto outside the analysis.

It doesn't have to pass to the mark. It was already discussed. We could pass it outside (named) blocks (operator, loop - whatever has a body inside curly braces).

Break would not work?


All in all, everyone has his own style and understanding, and that's the end of the matter.

SK. If you have any problems with this, please contact me, I will help you, subject to availability of time.

 
TheXpert писал (а) >> Break won't do?

This is only for loops or switch (by the way, not a very necessary construction, which can just as elegantly be replaced by an if...else chain). Everything is relative.

 
TheXpert писал (а) >>

Break would not do?

Generally speaking -- everyone has their own style and understanding, let's close the subject at this point.

SK. If you have any problems with it, I'll help you if I have time.

Break will not do. It has a limited effect.

And you should not be rude.

 
SK. писал (а) >>

And you shouldn't be rude.

I didn't think so.

 
Korey писал (а) >>

it's about Fortran as the primary source of numerical methods.
everything in it is tested and approved by the american association of engineers.
and here there is no problem - we work with DLL and that's it)))
and as if it exists - you want to insert directly into the MQ code, but you have to rewrite the algorithm, which is quite time consuming.

P.S. And most importantly, it's dangerous.

Fortran, there was goto. But it has nothing to do with efficiency of numerical methods. In MatLab it is implemented as much (even more) and there is no goto there. Goto has a history that goes back to the assembly language programming style (move to label). The seeming simplicity of this operator is misleading. Suppose there are five if attachments else. And did goto where you need and that's it, but then there are local and global variables, stack, pointers, arrays, etc. What to do with them? Implement correct output from attachments in assembler, taking into account all imaginable errors ((. It is hard to figure out how to do it correctly even in high-level language, while in assembler it is a real mess.

If I were the developer, I'd try to make MQL5 allow to attach programs written in MathCad(MatLab). It would be simple and easy (and not right hand on left ear). This is billions of man-hours saved + a giant step in the ability to process data. To give this capability, and the main effort to improve the terminal

Reason: