Fixed for you.Personal favorite of mine (from the first version of my 2D engine back in 2009)
runRight = new ANIM(); runLeft = new ANIM(); runBack = new ANIM(); runFront = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
Funniest line of code ever ?
Personal favorite of mine (from the first version of my 2D engine back in 2009)
runRight = new ANIM(); runLeft = new ANIM(); runFront = new ANIM(); runBack = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
Fixed for you.
You only fixed the formatting... There's more that should drive your OCD insane... Muahahahahaha!
Fine, refixificated.You only fixed the formatting... There's more that should drive your OCD insane... Muahahahahaha!
What can i say, the formatting apparently irritated me so much that i had to fix it immediately and could not see the wood for the trees.
Obvious joking aside, there is actually some reasoning in addition to readability to actually keep that kind of stuff lined up. For example, in VS you can edit multiple lines at the same time (alt-select) - useful when you later need to change stuff.
... speaking of which, i take you wrote the "= new ANIM();" stuff per line (copy-paste or otherwise) instead of writing all of them at once? *hint-hint*
Fine, refixificated.You only fixed the formatting... There's more that should drive your OCD insane... Muahahahahaha!
What can i say, the formatting apparently irritated me so much that i had to fix it immediately and could not see the wood for the trees.
Obvious joking aside, there is actually some reasoning in addition to readability to actually keep that kind of stuff lined up. For example, in VS you can edit multiple lines at the same time (alt-select) - useful when you later need to change stuff.
... speaking of which, i take you wrote the "= new ANIM();" stuff per line (copy-paste or otherwise) instead of writing all of them at once? *hint-hint*
Yup. I am an oldschool programmer set in the ways of Borland and other such IDE's. I use the more modern ones, however, my practices haven't changed.
Personal favorite of mine (from the first version of my 2D engine back in 2009)
runRight = new ANIM(); runLeft = new ANIM(); runFront = new ANIM(); runBack = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
Meh, I find the inane repetition far more annoying
for(auto anim : {
&runRight, &runLeft, &runFront, &runBack,
&idleRight, &idleLeft, &idleFront, &idleBack
}
)
*anim = new ANIM();
Personal favorite of mine (from the first version of my 2D engine back in 2009)
runRight = new ANIM(); runLeft = new ANIM(); runFront = new ANIM(); runBack = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
Meh, I find the inane repetition far more annoying
for(auto anim : { &runRight, &runLeft, &runFront, &runBack, &idleRight, &idleLeft, &idleFront, &idleBack } ) *anim = new ANIM();
except that this was written before C++ 11...
Meh, I find the inane repetition far more annoying
for(auto anim : { &runRight, &runLeft, &runFront, &runBack, &idleRight, &idleLeft, &idleFront, &idleBack } ) *anim = new ANIM();
This very vaguely reminds me of ad-hoc look up tables
typedef int a[];
int someValue = a{5,3,6,4,2}[n];
or
int someValue = array<int, 5>{{5,3,6,4,2}}[n];
except that this was written before C++ 11...
Meh, I find the inane repetition far more annoying
Personal favorite of mine (from the first version of my 2D engine back in 2009)runRight = new ANIM(); runLeft = new ANIM(); runFront = new ANIM(); runBack = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
for(auto anim : { &runRight, &runLeft, &runFront, &runBack, &idleRight, &idleLeft, &idleFront, &idleBack }) *anim = new ANIM();
So what?
ANIM** anims[] = { &runRight, &runLeft, &runFront, &runBack, &idleRight, &idleLeft, &idleFront, &idleBack };
for(ANIM*** anim = anims; anim != anims + 8; ++anim)
**anim = new ANIM();
Would be much easier in both cases if you hadn't made the mistake of naming everything and had made it iterable in the first place. (Sorry if the formatting is broken, on my phone right now)
personally i think it was a bad excuse why not to use that method, as it's more likely your real code would look something like:except that this was written before C++ 11...Meh, I find the inane repetition far more annoyingPersonal favorite of mine (from the first version of my 2D engine back in 2009)
runRight = new ANIM(); runLeft = new ANIM(); runFront = new ANIM(); runBack = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
for(auto anim : { &runRight, &runLeft, &runFront, &runBack, &idleRight, &idleLeft, &idleFront, &idleBack }) *anim = new ANIM();
So what?
runRight = new ANIM(2, imgA, imgB);
runLeft = new ANIM(2, imgC, imgD);
runFront = new ANIM(2, imgE, imgF);
runBack = new ANIM(2, imgG, imgH);
idleRight = new ANIM(2, imgI, imgJ);
idleLeft = new ANIM(2, imgK, imgL);
idleBack = new ANIM(2, imgM, imgN);
idleFront = new ANIM(2, imgO, imgP);
it's not likely your going to be creating an animation object without feeding them some unique parameters.
personally i think it was a bad excuse why not to use that method, as it's more likely your real code would look something like:
except that this was written before C++ 11...
Meh, I find the inane repetition far more annoyingPersonal favorite of mine (from the first version of my 2D engine back in 2009)
runRight = new ANIM(); runLeft = new ANIM(); runFront = new ANIM(); runBack = new ANIM(); idleRight = new ANIM(); idleLeft = new ANIM(); idleBack = new ANIM();//those of you with OCD will HATE me for these lines... idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.
for(auto anim : { &runRight, &runLeft, &runFront, &runBack, &idleRight, &idleLeft, &idleFront, &idleBack }) *anim = new ANIM();
So what?
it's not likely your going to be creating an animation object without feeding them some unique parameters.runRight = new ANIM(2, imgA, imgB); runLeft = new ANIM(2, imgC, imgD); runFront = new ANIM(2, imgE, imgF); runBack = new ANIM(2, imgG, imgH); idleRight = new ANIM(2, imgI, imgJ); idleLeft = new ANIM(2, imgK, imgL); idleBack = new ANIM(2, imgM, imgN); idleFront = new ANIM(2, imgO, imgP);
And again, if those images and anims weren't named and instead in an array, this could be done easily with a loop.
I'm just extremely annoyed by useless repetition. I have just seen too many people writing vector classes with named elements x, y, and z and having repeated code for each of the three dimensions just about everywhere.