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: nambla_dot_org_rules_you 2011-05-27 22:53

>>45
Stop backtracking you fucking retarded nigger.

BTW, the only way that original code could be considered optimial is if the OP had a conforming C compiler with full optimizations enabled.

And now...

" However we are superior to you and were able to expand on the problem putting it in a greater context (this is an abstraction of the problem, something you seem to struggle with)."

Again, for the third time, C can be considered portable assembler. One could view this as an abstraction of assembler. What part of this don't you understand you mental midget?

Maybe this would help with your mental lack of programming skill you fucking bitch. Say you have a piece of ANSI C code. When I compile and run this on the x86, I get an output. When I compile and run this on a SPARC, I get the same output. And when I compile and run this on the ALPHA, I get the same output.

However, in each case, the assembler is different.  Or as you would but it, you are abstracting the problem.

Again, you are a fucking stupid shit.

Name: Anonymous 2011-05-27 22:55

*would put it*

Name: nambla_dot_org 2011-05-27 22:56

And I'm still not convinced that you understand the relationship between your code and something like the C99 standard.

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