but if you’re referring to OP, your proposal does make the code arbitrarily/arguably more readable, in return for using switch and limiting the amount of chars. Either way, you have to validate incoming data from the api anyway, so I’m not inclined to make unnecessary castings and conversions. And I guess we’d have to cast the timeframe constants in the “case” also to long, possibly making it even more complex.
unless there is a compelling performance or integrity benefit, the added complexity makes the readability less intuitive, and verbose imho. But it’s matter of style i guess.
For instance, I agree i personally prefer the switch too for translations, however it’s a pity mql does not support strings with it.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
That’s not my code, I don’t use input = ‘m1’
but if you’re referring to OP, your proposal does make the code arbitrarily/arguably more readable, in return for using switch and limiting the amount of chars. Either way, you have to validate incoming data from the api anyway, so I’m not inclined to make unnecessary castings and conversions. And I guess we’d have to cast the timeframe constants in the “case” also to long, possibly making it even more complex.
unless there is a compelling performance or integrity benefit, the added complexity makes the readability less intuitive, and verbose imho. But it’s matter of style i guess.
For instance, I agree i personally prefer the switch too for translations, however it’s a pity mql does not support strings with it.