Styler in the MetaTrader 5 trading terminal - page 7

 
Renat :
Are there more items?

block placement styles:

ansi, java, k&r, stroustrup, whitesmith, banner, gnu, linux (details here)


format the indentation structure with tabs or as many spaces as you need.


do not break/not structure (true\false) a block of statements placed on a single line ( { ; ; ; ; ; } )


do not break (true\false) if else on the same line


parameter definition lists of functions in one line or "structured"

func(int i1, int i2, int i3, int i4, int i5, int i6)

or so

func

(

int i1,

int i2,

int i3,

int i4,

int i5,

int i6

)


do not align (true\false) comments that have // or /* located in the first position

Artistic Style
  • astyle.sourceforge.net
becomes (with break‑after‑logical):
 

I did ask for "how it works now, why it's wrong and how you propose to change the specific point".


There is no need for abstract styler rules. Our styler deals with the most basic sweep.


I suspect that our styler is being criticised on theory rather than fact. That's why I ask for specific points with claims.

 
Renat :

...our styler is criticised on theory rather than fact. That's why I'm asking for specific points of complaint.

I don't have a complaint - I have a request: make the settings I have listed

 
TheXpert :
class Class
{ // скобка на уровне объявления
private: // спецификаор на уровне объявления
   // приватные типы
   definition; // объявления и определения функций и членов с отступом
  
protected:
   // защищённые типы
   definition;

I'm in favour of having the access labels "recessed" inside the class too - they're part of the class. In general, the style should be adhered to so that nothing protrudes to the left between the paired opening and closing brackets.

Enlighten only on a question, why all these nuances, if style will be adjusted, and everyone will do as it is convenient to him?

 
bmp,png,jpeg,gif,tiff,huiff
 

Today I was horrified to learn that E. Allman, who for some reason is the name of the standard style, is an open homosexual and therefore urgently changed the style for Astyle from allman to bsd :


Asty.bat file:

astyle --indent=tab --indent=force-tab=3 --style=bsd --delete-empty-lines --pad-oper --unpad-paren --pad-paren-out %1 %2 %3 %4 %5 %6 %7 %8 %9


File astyr.bat:

astyle --indent=tab --indent=force-tab=3 --style=bsd --delete-empty-lines --pad-oper --unpad-paren --pad-paren-out --recursive *.c

.

 

By the way, I also remembered about VBA...

The formatting style there is strictly enforced by MS itself. And it is formatted right in the course of typing. i.e. i can type in as many spaces as i want, but as soon as i move to another line (or rather to another statement) the IDE automatically formats the text and the beginning of line moves in its place. thus the text is AUTO-FORMATED.

As soon as the cursor jumps to another operator in the editor, the syler is called and formats the text with the settings selected by the user. This operation is fast and the user will not be slowed down by it. The only thing to keep in mind is that it should only be called in this mode when the cursor moves away from the current OPERATOR, which can be multi-line.

Документация по MQL5: Общие функции / PrintFormat
Документация по MQL5: Общие функции / PrintFormat
  • www.mql5.com
Общие функции / PrintFormat - Документация по MQL5
 
mql5 :


on point 2: tabs are evil - try looking at the same code in different editors... it'll float, to put it mildly.

If there are tabs everywhere, it won't float.

For me, the evil - spaces, click the mouse at the beginning of the line (the beginning) or at the beginning of the test - to be a sniper.

 
ForexTools :

By the way, I also remembered about VBA...

The formatting style is rigidly imposed by MS itself. And it is formatted right in the process of typing. i.e. I can start a line with as many spaces as I want, but as soon as I move to another line (or rather to another statement) the IDE automatically formats the text and the beginning of the line moves in its place. thus, the text is AUTO-FORMATED.

Try it - what if you can make the option "Auto-format as you type"? as soon as the cursor jumps to another statement in the editor - the syler is called and formats the text with the settings the user has chosen. This operation is fast and the user will not be slowed down by it. The only thing to keep in mind is that it should only be called in this mode when the cursor moves away from the current OPERATOR, which can be multi-line.


I totally agree, auto-formatting is GOOD!!!

 

The styler converts the Russian letters into question marks in the lines with comments in Russian.

Is it going to be like that? Or is there a way to fix it?

Reason: