Let's make things more complicated... Code: //there could be more than one event during one tick, that's why we need: //indexBegin is the first event in the timeline of events since the EA got attached //indexEnd is the last event in the timeline void onError(EventType &e, EventIndex& indexBegin, EventIndex Index& indexEnd) { print(e.name(indexBegin)); // print first event in timeline print(e.name(indexEnd)); // print Last event in timeline } //----- Linkers::X(EventType &e, Index& indexBegin, Index& indexEnd) { switch (e) { case error: onError(e, indexBegin, indexEnd); break; // approaching nearest round number, print it case round_number: print(e.roundNumber()); } }
Stop assuming things you know nothing about. If you've never written code that "just flows", you can't understand.
Well, this song "just flows" Then i guess your code "just flows" like this "Silence" I'd like you to say your opinion about my code, do you think it "just flows" in silence or not?!
Excellent analogy. Your code should flow like Ave Maria. A light touch, an elegant voice and you have beauty as opposed to something engineered.
my code used to be Ave Maria when i was 13 and programming intro's and compression algorithms on commodore 64 back in 80's in pure Assembler. Today I'm not sure that it flows anymore.... You mean dubstep like this? Emphasis is on "better than a Hustler"
Aww that's cute, you're trying to establish your bona fides. I bow in the presence of such knowledge.
I tell what is Ave Maria for me... proprietary expandable size classes/containers with encrypted data storage with critical points written __ASM just to make sure that the trading information contained within is safe, waaaaay faster than the std:: implementations... xVector, xArray, xMap, xList, xString, xSeries, etc..... And as you said, the information "just flows"
Does such a setup make sense in all circumstances? With C++ concepts "around the corner" and templates, your algorithms shouldn't care about xVector vs std::vector. But they do. And so it doesn't flow.
As far as I can tell, the OP was not asking for you to perform a code review. To just say someones code is terrible without any context of their programming background is kind of lame. I don't disagree entirely with you regarding "if" statements. They can certainly be abused. I find I typically reduce the use of if statements by using abstract classes and interfaces where my if or select statement is in a factory class that creates the concrete implementations. That way the rest of my code just has to call the methods of the interface or base class. That being said, I still use if statements. What I usually avoid are else statements of nested if statements.