Linkers::X - Let's code in C++ , Daytrade & Daydream :)

Think at a level of abstraction higher than just literal statements. An if statement is representative of a class of conditional statements. As is a switch. A switch is just a DSL for a sequence of if statements. I'm so glad you know they compile to jump tables but you're going the wrong direction in level of abstraction.

Yes, I have problems with people using them because they write shitty state-filled code that I have to debug when I could be doing something more enjoyable.

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());
    }
}
 
Last edited:
You're arguing against an *if statement*. Please show me your code that has no if statements (or other conditionals) in it. You either handle multiple conditions or you don't and if your code doesn't then it's trivial. If it's all hidden behind an API or another layer of abstraction then they're still there, just abstracted away. Perhaps your real issue is that you dislike low level programming contexts and you have an issue with "digging ditches."

Stop assuming things you know nothing about.

If you've never written code that "just flows", you can't understand.
 
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?!
 
Last edited:
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?!

You should answer your own question: is your code Ave Maria or is it dubstep?
 
You should answer your own question: is your code Ave Maria or is it dubstep?

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"
 
Last edited:
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.
 
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"
 
Last edited:
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.
 
That code is terrible

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.
 
Back
Top