A suggestion for the ease of use of the MetaEditor - page 6

 
Комбинатор:
)) Well you know how to be rude, I have already understood, but I have not seen a substantiation of your point of view or a refutation of mine.

Belinsky certainly wouldn't express himself like that in a public place. So no complaints are accepted.

And no justification for the "vomit reflex" your references to authorities can not give.

 
Alexey Viktorov:

This is replicoid code.

I was talking about spaces after the comma separating parameters and characters

It reads better

than this.


So I gave an example to the contrary ))

Here's an example of my code, straight from live

    void SetThresholds(double &thresholdOpen[], double &thresholdClose[])
    {
        int signalIdx = 0;  ///////////////// !!!!!!!!!!!!!!!! пока задано жестко
        CSignalFilter *signal = (CSignalFilter*)m_SignalArr.At(signalIdx);
        if (CheckPointer(signal) != POINTER_INVALID)
        {
            signal.SetThresholds(thresholdOpen, thresholdClose);
        }
    }

***

 

Already noted on previous occasions, I'll say it again for a new audience.

Objectively, there are de-facto standards for styles. Now (and for the last 10 years) there are only 2 main ones for languages with syntax a la C++/Java. These styles were voiced by Combinator. They are used in the vast majority of companies in the software industry. They have proven themselves, they are tried and tested, they are logical, understandable and familiar to the vast majority of professional coders.

Trying to promote something else, without benefits and only with flaws, is a failure. Not acknowledging these flaws is nothing more than stubbornness. They are objective. It's clear that MQ itself is used and hooked on this style, but it's just another bug. This is how sometimes software refuses to fix known bugs, saying that there are already a bunch of third-party products that have latched on to this erroneous behavior. In fact, in all such cases, we should look for a solution that allows us to keep the old behaviour for backwards compatibility, but make the fixes with a so-called "protocol upgrade" or fork. In the context of styles, there is a simple solution: a styler that can be cloned. It could have been done a hundred times before.

In the MQ style, by the way, the problems concern not only the placement of brackets, but also the style of comments - they by definition cannot override the code, which is now observed in the MQ style.

 
Alexey Volchanskiy:

So I gave an example to the contrary ))

Here's an example of my code, straight from live

***

Then what was the smartass about?

 
Stanislav Korotky:

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Вот это стиль! :)

Sergey Kravchuk, 2009.11.24 11:27


Вот кусочек кода из MACD Sample.mq5 по-ихнему и по-моему:

Styler5                                  -|- Мой стиль
-------                                  -|- ---------
bool CSampleExpert:: LongModified()       -|- bool CSampleExpert:: LongModified()
  {                                      -|- {  
   bool res=false;                       -|-   bool res = false;
//--- check for trailing stop            -|-   //--- check for trailing stop
   if( InpTrailingStop>0)                 -|-   if ( InpTrailingStop > 0)
     {                                   -|-   { 
      if( m_symbol.Bid()- m_position. Price -|-     if ( m_symbol.Bid() - m_position. Pric
        {                                -|-     {
         if( m_position. StopLoss()< m_symb -|-       if ( m_position. StopLoss() < m_symb
           {                             -|-       {
            double sl= m_symbol.Bid()- m_a -|-         double sl = m_symbol.Bid() - m_a
            double tp= m_position. TakePro -|-         double tp = m_position. TakeProfi
            //--- modify position        -|-         //--- modify position
            if( m_trade. PositionModify( Sy -|-         if ( m_trade. PositionModify( Symbo
               printf("Long position by  -|-           printf(" Long position by % s to
            else                         -|-         else
              {                          -|-         {
               printf("Error modifying p -|-           printf(" Error modifying positi
               printf("Modify parameters -|-           printf(" Modify parameters : SL
              }                          -|-         }
            //--- modified and must exit -|-         //--- modified and must exit fro
            res=true;                    -|-         res = true;
           }                             -|-       }
        }                                -|-     }
     }                                   -|-   } 
//---                                    -|-   //---
   return( res);                          -|-   return( res);
  }                                      -|- }

Nowhere to learn the style, but the version on the right is "My style", as if I had written it myself. The one on the left is much harder to read for some reason. I'm not sure if it's a matter of habit.


Vladimir Karputov:
forum, kodobase should be filled with code in the same design.

Absolutely not! There was a time when it was required to change the style of method/field names for publication. For example, instead of this.i, write this.m_i. The same requirements for class names - that they start with the letter C. Fortunately, common sense prevailed and we have no more such demands.

Forum on trading, automated trading systems and testing of trading strategies

A suggestion for the ease of use of MetaEditor

Combinator, 2017.09.28 15:00

I use Olman style.

void f()
{
   // some code
   if (condition)
   {
      // some code
   }
}

Or at the very least K&R.

void f() {
   // some code
   if (condition) {
      // some code
   }
}

These two styles take the lead over the others by a huge margin. Both have clearly readable code nesting. You can see where the block belongs, no formatting problems.

Your style is under-GNU, the disadvantages I've voiced above. GNU at least has the same indent from and to the curly lines.

Turns out I've always used Olman style! K&R - annoying for some reason, although I've seen top olympiad leaders really like this style.

Forum on trading, automated trading systems and strategy testing

A suggestion for the ease of use of MetaEditor

Combinator, 2017.09.28 15:15

While we're at it, the other awkward thing about ME is the register-dependent autocomplete.

In all good editors it is case insensitive, so it makes life easier.

I completely agree.
 
Rashid Umarov:

You can treat me however you like. I am not a hundred dollar note to please everyone.

The important thing is that I have voiced an opinion that has been heard and may even be taken into account.

 
Stanislav Korotky:

Already noted on previous occasions, I'll say it again for a new audience.

Objectively, there are de-facto standards for styles. Now (and for the last 10 years) there are only 2 main ones for languages with syntax a la C++/Java. These styles were voiced by Combinator. They are used in the vast majority of companies in the software industry. They have proven themselves, they are tried and tested, they are logical, understandable and familiar to the vast majority of professional coders.

Trying to promote something else, without benefits and only with flaws, is a failure. Not acknowledging these flaws is nothing more than stubbornness. They are objective. It's clear that MQ itself is used and hooked on this style, but it's just another bug. This is how sometimes software refuses to fix known bugs, saying that there are already a bunch of third-party products that have latched on to this erroneous behavior. In reality, in all such cases, we should look for a solution that allows us to keep the old behaviour for backwards compatibility, but make the fixes with a so-called "protocol upgrade" or fork. In the context of styles, there is a simple solution: a styler that can be cloned. It could have been done a hundred times before.

By the way, in MQ style problems concern not only the bracketing, but the style of comments - they by definition can not prevail over the code, which is now observed in the MQ style.


I'll add about comments - try to process them with any autodocumentation system, you'll be disappointed.

 
Alexey Viktorov:

Then what was the smartass about?


br-r-r-r-r, I gave an example of code_without_spaces_and_ commas

remove the underscores.

 
Alexey Volchanskiy:

br-r-r-r-r, I gave an example of code_without_spaces_and_ commas

remove the underscores

who did you give an example of code without spaces?
 
Rashid Umarov:

You do allow yourself to 'vomit'.

Roche, what's the problem with gagging? I, too, have the MQ style, and am I being sarcastic by saying so?

Format the kodobase however you like, it can even be done automatically when you load the code, without straining the coder. I'm just remembering: I write code, style it for MQ, save it under a new name and upload it for review. Then I cancel styling and continue writing. Isn't it nonsense?

I don't have resources for a customizable styler. It's not like anyone's making it fit.
But why take the cross, and go tell everyone that your faith is the correct one (with absolutely no arguments!)??