Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Elegance vs. Performance

Name: Anonymous 2011-05-27 4:11

So /prog/, what would you choose between these two snippets of C code...


int *arr[3];
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;


or...


int i;
int *arr[3];
for (i = 0; i < 3; i++)
  arr[i] = i+1;


The second one is more elegant, but requires more operations.

Name: Anonymous 2011-05-27 13:01

>>22
I find it improbable that >>1 or >>13 are using anything else than x86 or x86_64. Feel free to prove me wrong though. I'm also sure you'd be able to modify the assembly code to fit your ``non-standard'' architecture if you're using one, the examples listed are minimal. I'd also be hard pressed to say that anyone here didn't know that assembly code was architecture specific, it's practically by definition. The fact that you even bothered to type such an obvious statement indicates that you are unintelligent, yet want others to view to you highly, in which case I must advise you to not take /prog/ this seriously, relax this is just a textboard.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List