Features of the mql5 language, subtleties and tricks - page 213

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
And there is no need to change the behaviour of existing functions - it is enough to add new correct functions (with some prefix/suffix) and declare the previous ones obsolete with a corresponding warning
Destroy the whole sense of FileReadArray? Think of these functions as a backup of a piece of memory. Just bytes.
Destroy the whole point of FileReadArray? Think of these functions as a backup of a piece of memory. Just bytes.
So you want to first create difficulties for yourself through private, const and then heroically overcome them through "direct" memory access?
I have a different approach - if such a need arises, it means that the program was improperly designed from the very beginning
I.e. you propose to first create difficulties for yourself via private, const
I always get great benefit from private/const. They allow you to control the architecture of the program very well.
and then heroically overcome them with "direct" memory access?
No overcoming. Everything is very simple and logical.
My approach is different - if such a need arises, it means that the program was wrongly designed from the very beginning.
I understand that they are ready to write everything in a heap (without private/const), depriving convenience of architectural control for the sake of "purity" of OOP.
The File... appeared when privacy and constancy didn't exist, we didn't think to change this behaviour yet, as we don't consider it critical.
CharArray<->Struct appeared recently, but they work fine with private/const. Hopefully they won't be revised.
I understand that you are ready to write everything in a heap (without private/const), depriving convenience of architectural control for the sake of "purity" of OOP.
You misunderstand - from OOP point of view the object is self-sufficient (it does not need external functions) - therefore there is no conflict with private. And if there is a conflict with const, as correctly noted:
For more information about the forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5, tips and tricks
Ilyas, 2021.11.17 21:45
constant fields means not constantI understand that you are ready to write everything in a heap (without private/const), depriving convenience of architectural control for the sake of "pure" OOP.
You are willing to use any loopholes of direct memory access out of convenience instead of using less convenient but safer canonical approach.
rather the opposite. you are willing to use any loopholes of direct memory access out of convenience instead of using the less convenient but safer canonical approach.
Two requests:
Well, that's a fierce bug. Example:
The memory is allocated, the destructor is called when it is released (which hints at the expected behaviour according to RAII), but the constructor is forgotten to be called when the object is created)))
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5, tips and tricks
Vladimir Simakov, 2021.11.18 14:11
I have not seen it before.