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 17:31

>>31
"I must share >>28 sentiment here, the optimal C solution has been posted, and it wasn't the assembly code. Again you're unable to properly generate an abstraction,"

I believe it was Dr. Richtie that said that C was portable assembler. How much more abstraction do you want you fucking idiot?

"the assembly code posted in this thread gives a general idea what processors are able to do, they can move bits between memory and registers. "

C89, C90, and C99 don't make any reference to C being dependent on assembly. Perhaps you should actually read one of the C standards instead of making up your own definition of what C is.

"However, you are still stuck at an infantile level of communication, sticking to worthless insults, you also seem to lack basic reading comprehension. "

You're projecting. I'm not the only trying to include shit that outside the standard definition of C.

"Either way I'd recommend you think a little more before you post,"

This is coming from a person who writes at the 8th grade level.

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