Feedback on MQL5 - page 7

 
Renat Fatkhullin:

A stylist's description of the rules cannot be summed up in a few lines of fictional text.

It formats the way we have laid down.

Hello!

The fact that the styler formats only the way you have laid down and nothing else is a bit strange. Let me explain.

MT is a Windows platform. The main development tool for Windows is MSVC, while MT is written in MFC. This library adopts the Kernighan and Ritchie's variant of the indentation and formatting standard. So, for a person who has spent all his life in MSVC (and there are most of them in Windows) to see 3 spaces as tab and 2 extra spaces before "{" and also no space between straits (if, for...) and following parenthesis is a bit ridiculous and disturbs code reading. I understand you have adopted this format as a corporate standard, but it doesn't apply to other developers.

That's why I suggest introducing some styler settings, everyone will say a very big thank you.

 
SeriousRacoon:

Hello!

The fact that the styler only formats the way you want it formatted and not in any other way is a bit strange. Let me explain.

MT is a Windows platform. The main development tool for Windows is MSVC, the MT library is written in MFC. This library adopts the Kernighan and Ritchie's variant of the indentation and formatting standard. So, for a person who has spent all his life in MSVC (and there are most of them in Windows) to see 3 spaces as tab and 2 extra spaces before "{" and also absence of space between properties (if, for...) and bracket that follows is a bit ridiculous and disturbs code reading. I understand you have adopted this format as a corporate standard, but it doesn't apply to other developers.

That's why I suggest introducing some styler settings, everyone will say a very big thank you.

A small correction, Microsoft codestyle is not a K&R standard. The K&R standard is basically a curly bracketed difference, it's designed to fit as many lines as possible on the screen of the PDP-11 and other alphanumeric displays - 80 characters * 25 lines. By the way, here's a link to the book, maybe someone will find it useful http://rabus.ru/KernighanRitchie_C/index.html#content

/* подсчет строк, слов и символов */
main()
{
    int с, nl, nw, nc, state;
    state = OUT;
    nl = nw = nc = 0;
    while ((с = getchar()) != EOF) {
        ++nc;
        if (c == '\n')
            ++nl;
        if (c == ' ' || c == '\n' || c == '\t')
            state = OUT;
        else if (state == OUT) {
            state = IN;
            ++nw;
        }
    }
    printf(“%d %d %d\n”, nl, nw, nc);
}

Otherwise I agree and it's been written about 100500 times already. Personally, I take all MQL third-party texts to the studio and reformat them there.

 
Alexey Volchanskiy:

Slight correction, Microsoft's codestyle is not a K&R standard. The K&R standard is mostly a curly bracketed difference, it's designed to fit as many lines as possible on the screen of the PDP-11 and other alphanumeric displays - 80 characters * 25 lines. By the way, here's a link to the book, maybe someone will find it useful http://rabus.ru/KernighanRitchie_C/index.html#content

Otherwise I agree and it's been written about 100500 times already. Personally, I take all MQL third-party texts to the studio and reformat them there.

Yes, the difference is with the opening bracket, otherwise similar, that's why I called it a "variant".

It would be easier if МТ environment had User Tools, so I could attach third-party beautifier, but it's not possible. Optionally use third party editor with stdout output support from user tools (Editplus is a classic, but there are more interesting solutions), but it's just an extra crutch. I use Unscrutify configured in UniversalIndentGUI.

 
 
urusov:

Please:

https://www.mql5.com/ru/forum/35326

https://www.mql5.com/ru/forum/1111/

Name one commonly used language where I can't assign a different address to a pointer? Name one other widely used language where I can't assign a reference of the same type to a different object? Where else would I be forced to describe a constructor or copy function due to these limitations of your language?

And if controllability is paramount to you, why don't other controlled languages impose similar restrictions?

Personally, for me, it's not safety and controllability that comes first, but the speed with which I can implement an idea; this is extremely true in the context of trading ideas; those who disagree with this either overestimate the value of their systems, or program for the sake of programming, not a specific result.

C# you know, it's an industrial language now, has already largely replaced C++ in business/internet applications. So there are no pointers, or rather they are there, but unsafe, and nobody needs unsafe code, only for personal crafts.
 
Alexey Volchanskiy:
C# you know, it's an industrial language now, has already largely replaced C++ in business/internet applications. So there are no pointers, or rather there are, but unsafe, and nobody needs unsafe code, only for personal crafts.
any advantages of c sharp for ordinary people?
 

And why is a naked pointer so bad? If you don't do with strict aliasing optimizations, pointers are pretty safe in general (msvc did that).

In general, all this talk about security is just veiling the real reasons, as it was said before. And the reason is simple, I think - do not allow to know in any way addresses of functions to be passed to dll. A buried system doesn't need the outside world.

 
Or is the MC OK with normal colbeks? I have an idea, is the subject not taboo?
 
Alexey Volchanskiy:
C# you know, it is now an industrial language, has already largely replaced C++ in business/internet applications. So there are no pointers, or rather, they are there, but unsafe, and nobody needs unsafe code, only for personal crafts.

By the way!

Once upon a time I met a comparison of C and Pascal languages

The C language is driving a Ferrari on a mountain road at 180 km/hour,

and the Pascal language is a quiet ride in a limousine on a wide, one-way road at 40 km/h.

C was meant to be, like, a real man's language.)

In the C, you've got to keep your eyes on the signposts :-) The C language is not for the faint of heart, because if you don't follow the signs you risk flying off the track on a hairpin bend.

C is the language of operating systems and utilities, drivers. C was originally written by pros who wrote the operating systems and utilities for users.

Pascal was originally written in C for students. Pascal was written as an instructional language.

The difference in purpose and use of the tools is obvious.

MQL is essentially a derivative of C , the choice of the MetaQuotes developers is professionally very correct.

 
Yuriy Zaytsev:

By the way!

Once upon a time I met a comparison of C and Pascal .

The C language is driving a Ferrari on a mountain road at 180 km/hour,

and the Pascal language is a quiet ride in a limousine on a wide, one-way road at 40 km/h.

C was meant to be, like, a real man's language.)

In the C, you've got to keep your eyes on the signposts :-) The C language is not for the faint of heart, because if you don't follow the signs you risk flying off the track on a hairpin bend.

C is the language of operating systems and utilities, drivers. C was originally written by pros who wrote the operating systems and utilities for users.

Pascal was originally written in C for students. Pascal was written as an instructional language.

The difference in purpose and use of the tools is obvious.

MQL is essentially a derivative of C. The choice of the MetaQuotes developers is professionally very correct.

What difference does it make at all what language to write in?

(After all, you can write drivers and everything else in Pascal).

It is important to understand what and how you do it, and the programming language is a double matter!