Styler in the MetaTrader 5 trading terminal - page 2

 
Renat :

Unified styling is important for MQL5.community, as we collect a huge database of sources in the Code Base. This means that these sources will be read by a huge number of third-party developers and users.


To avoid creating an incomprehensible collection of code, all of the published scripts will be automatically

  1. cleaned by styler
  2. be checked for correctness
  3. generate standard screenshots for indicators

It's clear that for the global task of training archives it's extremely important to have a consistent style.

Do not make hasty decisions!

1. Styler can be used by anyone in the editor. There is no need to change the code before publishing - if the user wants, he/she will do it in the editor.

2. I don't agree that the current style deserves to be unified for MQL5.


Pegasmaster wrote >>

if ( ...
{
   for (
   {


   }
}

I think this is the classic style. I don't remember exactly, but Van Tassel's book explains the style quite well.

There you go. I join in.

 
TheXpert :

Don't make any hasty decisions!

1. The styler can be used by anyone in the editor. There is no need to change the code before publishing - if the user wants to, they will do it in the editor.

2. I don't agree that the current style deserves to be unified for MQL5.


+1000!
 
Renat :

A couple of thousand scripts in the MQL4 Code Base have passed through the hands of our editors, who would have expressed themselves much harsher about the styles used.

It all makes sense.

Nerves

should be

take care


 

I don't understand what's the problem!

why is it so hard to make custom styles and add "MQL5 Standard" to them and make all coders publish their code in a codebase BEFORE publishing it, they MUST format it using standard style.

But in those codes I'm writing for let me format the text as I like.

Please! What's it worth to you? Just a simple, universal stooler setting! :))))))))))))))

 
coaster :


This surprised me. I always thought that a mistake in setting this so called "design element" could drastically change the code. But it turns out that it's not a code element at all. Here is an example:

The compiler said: "it's OK!". But the program won't work. Where is the error? In the layout? Or in the code?

Maybe. But I know from my own experience that the two styles may well get along with each other. In MQL5 I'm using the styler all the time (and I'm not complaining). In Java I'm using the built-in style of IDE. For example:

    public static int searchStringInArray(ArrayList<String> array, String match) {
        int found = 0;
        match = match.trim();
        for (String s : array) {
            int pos = s.indexOf(match);
            if (pos >= 0) {
...
                found++;
            }

        }
        return found;
    }
The question of placement of brackets ( close to the covered code or one character closer to the left edge) is not crucial.
 
Renat :


Programmers write code not for themselves, though they mistakenly think it's for themselves. Sound familiar?


That's what I'm saying! Different colours and tastes... :)

The unified style in MQL5.Community - let it be its calling card.

But just make it possible to make personal style settings in the Expert Advisor.

It's a bit annoying when you start cleaning spaces and removing brackets in Expert Advisors.

 

I'm sorry, I don't know what they're fighting about... When publishing on the website, I don't see the point of using "non-standard formatting", but if you organize it in the editor, it's a very positive idea, because it gives the newbies an idea of formatting code text, who have no idea that the text needs to be formatted at all. But for those who know about formatting, it is a great help in their work, and there will be a choice what style to use. The seeming insignificance of the question is wrong. Let's say a programmer gets a terrible code ..... For my part, I look at it and decide that it will take me longer to format the code to understand it, I decide not to get involved... the questioner is left unanswered... If it is possible to format the received text in the editor, then the work will start on the question posed, and not on the dissatisfaction with the code formatting. extra styles when publishing - no, extra styles in the editor - yes!

Документация по MQL5: Общие функции / PrintFormat
Документация по MQL5: Общие функции / PrintFormat
  • www.mql5.com
Общие функции / PrintFormat - Документация по MQL5
 
I can't understand what this thread is about? A request for an opportunity or who's comfortable with it?

You just say you won't change anything and that's it. The thread will die quietly.

Or are you holding a secret ballot?

 
It's very common to see newcomers' codes. It's the quietest horror. As they say, you close your eyes and walk on foot.
 
sergeev :
I can't understand what this thread is about? about the request for a possibility or about how it's convenient for who?

You just say you won't change anything and that's it. The thread will die quietly.

That's what I'm talking about!

My first question was: WHY did they do it that way? I got an answer - MK decided to introduce their own source code standard.

My second question was: can I (without touching the "MK standard") ADD my own standard for my own (as a user) internal use?

There is no answer to it.


If the Chair will add a customizable formatting feature - I (and I'm probably not the only one) will be very happy to use this feature.

If not - I'll just forget for ever that MT5 has such a menu item and I'll continue combing all kind of "not my" code with Astyle for myself. Even the codes downloaded from codebase according to MC standard ;)

Reason: