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 20:08

>>37
"Before you do that I see no point in conversing with you, you seem to be very unintelligent and your behavior is infantile, at the very least basic education should make you somewhat acceptable."

You still have yet to cite a passage from C89, C90, or C99 that cites using assembler as part of the C standard.  Do you even know why we have standards? I bet not you faggot? Do you know how your compiler is implemented in relation to these standards? Again, I bet no. I'm willing to bet that you've never even attempted to write an ANSI/ISO C compiler.

Christ you are one stupid sob. Go back to playing with your barbies. I'm sure barbie and ken will believe your made up definition of C.

Name: Anonymous 2011-05-27 21:19

>>21
This could probably be done in 1 or 2 MMX instructions, but I can't be bothered looking them up right now.

Name: Anonymous 2011-05-27 21:39

100% PURE ANAL!

Name: Anonymous 2011-05-27 21:54

100% PURE ANAL TURING!

Name: Anonymous 2011-05-27 22:23

>>41
Again you are poorly regurgitating common knowledge, everyone here knows what the C standard is, nobody will think you are intelligent for knowing what the C standard is.

If you could contain your learning disabilities long enough to read my posts you'd realize that I never once stated that the assembly code was C, I never once stated the optimal C solution was the assembly code and I never once stated that the optimal C solution was written in anything but ANSI C.

The assembly code was a continuation of the debate, if the optimal C solution already has been posted the problem (within the context of C) is solved and therefore not longer interesting. You probably like to jerk over old knowledge as evident by your continued stating of the obvious in this thread and I guess that is how inferior minds work. 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).

Now, I realize that it might be humiliating to be publicly destroyed like this, especially when the person destroying to you is a male that is superior to you in every other aspect of life, including (but not limited to) athletic, academic and romantic accomplishments. However you must not let this affect you that much, even though you are probably devastated at this point rest assured that nobody probably thinks any worse of you, you didn't seem intelligent before this happened.

Judging by the way you interact with others you are probably somewhere around twelve or thirteen years old, that's good though, you have your entire life ahead of you. So go on child, leave the adults alone and play with your toys, as opposed to nursing your arse pain on /prog/.

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.

Name: Anonymous 2011-05-27 23:49

>>46-48
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.
Thank you captain obvious.

And I'm still not convinced that you understand the relationship between your code and something like the C99 standard.
Believe me when I say that I'm wholly unconcerned with what you believe. Don't you get it? I simply don't care. You don't matter to me, you don't matter to anyone, nobody gives two shits about you.

Or as you would but it
You should relax more, this is just a textboard, your arse pain is showing, you can't even type correctly now, that's even worse than before. Although, perhaps it's normal to lose basic functionality when you're currently in a state of mental devastation after being publicly humiliated and destroyed by me, the superior male, not that you were functioning very well before that.

Name: Anonymous 2011-05-28 2:17

Conversation about C and compiler optimization. Okay, cool.
Go to work.
Come  back from work.
Argument about language definition/semantics.
Come on, /prog/. Really?

Name: Anonymous 2011-05-28 3:03

>>46-48
u buttmad

Name: Anonymous 2011-05-28 3:41

>>49
You should relax more, this is just a textboard, your arse pain is showing, you can't even type correctly now, that's even worse than before. Although, perhaps it's normal to lose basic functionality when you're currently in a state of mental devastation after being publicly humiliated and destroyed by me, the superior male, not that you were functioning very well before that.

Dearest Salutations Bro,

My name is Mugabe Mbogo, cousin of recently deposed Prince Christopher Moot Mpoolo XVI. It is with a hearty and warm smile that I cheerfully inform you that you are posting on what is probably the most technically precise board on all of 4chan, and as such you have lost the argument hard by looking down on standards and declaring that you do not care.

Further, dearest and kind Bro, as you decided to pull out the "superior male" schtick, you will probably never be invited to any parties around here ever again. You should spend a very long time reconsidering your goals in life, as you have just exerted a significant amount of testosterone alienating the only people who are likely to give more than half a fuck.

Sincerely and wishing your family the best health,

Mugabe "Go the fuck back to /g/ you retarded knuckle-dragger" Mbogo.

Name: Anonymous 2011-05-28 4:03

>>52
suck my dick faggot

Name: nambla_dot_org_rules_you 2011-05-28 11:04

>>49
You were, and probably still are, confused about how assembler gets "abstracted".

"Believe me when I say that I'm wholly unconcerned with what you believe. Don't you get it? I simply don't care. You don't matter to me, you don't matter to anyone, nobody gives two shits about you."

Maybe. But unlike you, I actually do this kind of shit for a living.

Name: Anonymous 2011-05-28 11:32

>>54
You get paid to misinterpret arguments and derail threads with your idiocy?

Name: Anonymous 2011-05-28 11:52

>>55
I'm not the one who fucking doesn't understand that C basically abstracts assembler. Want me to cite some of your previous posts that demonstrate this confusion?

You also made *zero* comments about how your shit assembler code was outside the realm of standard C. I'm suspecting you omitted this comment because you've never actually read one of the standards.

Again, you are stupid. Your posts are ambgiuous, and you show zero scholastic aptitude when you do any kind of technical writing.

Again, go back to playing with your barbie dolls and leave the computer programming to the men.

Name: Anonymous 2011-05-28 12:17

>>56
It doesn't though. There are many things you can do in most every assembly language that you can't in C. Freedom of calling convention, code-as-data-as-code, optimisation. It doesn't abstract it, just limit it and make it a bit more human-readable.

Name: Anonymous 2011-05-28 12:18

>>56
Again, your an anus!

Name: Anonymous 2011-05-28 12:20

>>56
C basically abstracts assembler
nope

Want me to cite some of your previous posts
Sure, this should be interesting.  Good luck finding any.

assembler code ... outside the realm of standard C
Right, and my C code is outside the realm of standard Python.  What kind of retard consults the standard of the wrong language and whines that the language in question doesn't conform to it?

Name: Alpha Male !JsUWe2wpCw 2011-05-28 12:43

>>56

Just for your information >>55 isn't the guy you've talking to so far. Just figured I would tell you before you embarrassed yourself even farther, it's quite obvious you blatantly misunderstood a post written in simple English and let your poor social skills take over from there.

I'm going to start posting with this name so you'll know who I am, and in case there is any confusion: I'm the dude who publicly demolished you.

You're not as clever as you think you are by the way, stating the obvious around the office will probably make you feel intelligent but I'm pretty sure your coworkers think of you as a moron. I'm pretty sure they laugh at you when they say something and you start calling them autistic Jews. That's how you come off as by the way, comical, and perhaps a bit tragic, since any short post will lead you to ranting for a couple of posts riddled with spelling mistakes, calling people niggers and telling them to play with barbie dolls while stating the last thing you read about on Wikipedia, all the while confusing yourself on who is who.

Your life must be pretty disappointing, you're not very good at what's supposed to be your job, although I'm certain this is only a short term job, I'd hate to think that your future was in this.

Earlier I advised you to leave /prog/, now I won't though, I'd hate to be deprived of your gay banter, every place needs someone to laugh at. However, before you throw your next fit I am going to recommend that you relax more, perhaps think a little more before you post, make sure you iron out those spelling mistakes, I'm sure you can do it if you really put your mind to it. Keep in mind that nobody here takes you seriously, if you wish to be taken seriously I'd cut down on the autistic Jew remarks, and perhaps attempt to read and think before you post.

Last but not least, you lost the argument, you made a simple mistake, and instead of simply acknowledging that you made a mistake as any adult would do you started raging like a little child, blaming me for your own shortcomings.

Name: Anonymous 2011-05-28 13:06

I would have the compiler place the constants in the initialized data segment.

Name: nambla_dot_org 2011-05-28 15:02

>>59
"Right, and my C code is outside the realm of standard Python.  What kind of retard consults the standard of the wrong language and whines that the language in question doesn't conform to it? "

The original code was in C, not assembler you halfwit. You started to rattle about shit that doesn't fall within the realm of standard C. I just pointed out that your shit assembler code wasn't covered in any of the known C standards. I never once mentioned any kind of assembler standard. You did. I suspect you did this because you are a mental retard.

Again, you are stupid. And again, go back to playing with your barbie dolls. I'm sure barbie will believe your misconceptions about assembler and its relation to C.

Name: Anonymous 2011-05-28 15:05

>>59
Or better yet you fucking mental retard, instead of acting like some jackass bitch in heat when someone calls you out like the dumbass nigger that you are, why don't you instead take the time to learn how to write a C compiler and linker.

I'm pretty sure that this excercise would clear about your gross misconceptions about C, assembler, and how they are related to each other.

Name: Anonymous 2011-05-28 15:05

*would clear up*

Name: Anonymous 2011-05-28 16:04

>>62-64

u mad?

Name: Anonymous 2011-05-28 18:11

The Jews are after me

Name: Anonymous 2011-05-28 18:12

The Jews are after me

Name: Anonymous 2011-05-28 19:11

python: succinct elegance AND blazing performance

u jelly, c fags?

Name: Anonymous 2011-05-29 1:09

>>68
Lisp
FTFY

Name: Anonymous 2011-05-29 1:37

>>68

>Python
>Performance and Elegance

You're just as slow as Ruby, with half the beauty.

Name: Anonymous 2011-05-29 2:34

>>70

Nothing is as slow as ruby, please leave together with your imageboard fail quotes.

Name: Anonymous 2011-05-29 2:42

>>71

Python 3 and Ruby 1.9 are the same speed, more or less.

Name: Anonymous 2011-05-29 3:13

I would probably just implement a buttsort.

Name: Anonymous 2011-05-29 9:22

>>73
same.

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