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
This is all understandable. It is not clear whySetSaveRequired() andGetSaveRequired() are non-static, but write to a static variable.
I don't understand it, that's why I asked for help. I rarely use modifiers, operating more as an intuitive method, but i always want to find the best solution
Let me try it in the code, it's like this
publicGetSaveRequired() is used in a class to manage all this zoo of strategies
with this pattern I write only methodNextStepStrategy - only in it changes for TC, everything else is the same, so in the base class CStrategy I collect all the methods and all the fields - they are not much
ZS: with my back I feel that not ace my code, but it will definitely work and will not create duplicates of variablef_save_required;
This is what I don't understand, that's why I asked for help. I rarely use modifiers, I use them more intuitively, but as always I want the best solution
Let me try it in the code, it's like this
publicGetSaveRequired() is used in a class to manage all this zoo of strategies
with this pattern I write only methodNextStepStrategy - only in it changes for TC, everything else is the same, and therefore in the base class CStrategy I collect all the methods and all the fields - they are not much
ZS: with my back I feel that not ace my code, but it will definitely work and will not create duplicates of variablef_save_required;
I would remove these functions altogether.
All the functions that do not change the structure, make them constants.
All non-constant functions should set write flag.
I would also add the Save( int fileHandle ) function. This function should write the structure and reset the flag.
You can make a static function to get the state of the flag.
I would remove these functions altogether.
Make all functions that do not change the structure constant.
All non-constant functions should set write flag.
I'm telling you, I'm having trouble with modifiers in general.
SZY: in the meantime what is going on in general in the web in programming discussion - here was an article about const on hobber last month, the meaning - this const is not necessary, look assembler code is no different without const - the compiler will take it all away ((
I'm telling you, I'm having trouble with modifiers in general.
I googled and read, something went wrong again...
2019.09.13 21:10:54.316 tst (EURUSD,H1) x = v
2019.09.13 21:10:54.316 tst (EURUSD,H1) x = v
2019.09.13 21:10:54.316 tst (EURUSD,H1) x = v
Googled, read, something went wrong again...
2019.09.13 21:10:54.316 tst (EURUSD,H1) x = v
2019.09.13 21:10:54.316 tst (EURUSD,H1) x = v
2019.09.13 21:10:54.316 tst (EURUSD,H1) x = v
This is an overload for a constant class.
Hmmm... right, I spent nearly half an hour reading both the hub and the forums, but I couldn't get the hang of it.
Thanks! Now I've got it
There is still the suspicion of such an example:
2019.09.13 22:04:34.295 tst (EURUSD,H1) (const) x = v
2019.09.13 22:04:34.295 tst (EURUSD,H1) (const) x = v
2019.09.13 22:04:34.295 tst (EURUSD,H1) (const) x = v
2019.09.13 22:04:34.295 tst (EURUSD,H1) const
2019.09.13 22:04:34.295 tst (EURUSD,H1) const
2019.09.13 22:04:34.295 tst (EURUSD,H1) const
I can download the current lecture. So far, of course, the trivial stuff.
I'm attending a lecture on OOP at the moment. (Maybe I'll share what I'll learn))
I may download the current lecture. So far, of course, the trivial stuff.
Well, your lecture is most likely in gibberish, while here you can hardly learn anything in Russian, you've gone around the Internet for the third time... the overall situation is similar to the one here on the forum, there are no more than 10 real programmers and the rest are geeks
Ok, the overall situation has cleared up with const, I've worked with the rest of the modifiers, so I've had enough theory... I need to apply it, but I feel like a student )))
Well, your lecture is most likely in gibberish, while here you can hardly learn anything in Russian, you've gone around the Internet for the third time... the overall situation is grim like here on the forum, real programmers - no more than 10 people on the resource, the rest are geeks
Ok, the overall situation has cleared up with const, I've worked with the rest of the modifiers, so I've got a lot of theory ... I feel like a student ))).
Yes, I too have a similar situation. Learning is not difficult, it's harder to retrain, break old habits. I still can't kick many bad habits of procedural programming.
I'd like an example, I'm telling you, I'm not good with modifiers at all.
SZY: moreover in general the horror what is going on in the web in programming discussion - here was an article about const on hobber last month, the meaning - yes, this const is not necessary, look assembler code does not differ that without const - the compiler will remove everything (((
You may simply forget about constants and statics for now. On interfaces too.
And when everything is ready, then look and mark something as a statics and something as a constant. And you can forget about interfaces altogether.