Ping ([info]zestyping) wrote,
@ 2008-01-25 15:11:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
zestyping ... you're an idiot.
There are so many more thoughtful and significant things i've been wanting to post about for a few weeks now. I hope i get to them. But today i couldn't resist posting a link for you:

Best comment EVAR.

zestyping ... you're an idiot. I rest my case.

Why?

How about this comparison ... you can stick it in any language you want even your asss...
try this piece of code on any compiler....

if ("zestyping" > "all idiots around the world") {
echo "It's true, on all compilers";
}
...wow...I'm amazed ... it returns true, they should stop you from touching the keyboard.
OMFG.
I'm still laughing.


(Post a new comment)

But wait, there's hope!
[info]cuthalion
2008-01-25 11:26 pm UTC (link)
That doesn't work in C

-bash-3.1$ cat zestyping.cpp

#include 

#define echo std::cout <<

int main( ) {
  if ("zestyping" > "all idiots around the world") {
    echo "It's true, on all compilers";
  }
}
-bash-3.1$ g++ zestyping.cpp
-bash-3.1$ ./a.out
-bash-3.1$ 


(You're comparing pointers to constants which are probably going to be in the order you declare them)

(Reply to this)(Thread)

Re: But wait, there's hope!
[info]cuthalion
2008-01-25 11:27 pm UTC (link)
oops, that should be #include <iostream>

(Reply to this)(Parent)

Re: But wait, there's hope!
[info]catamorphism
2008-01-26 01:21 am UTC (link)
AFAIK, C doesn't specify any semantics for how pointers to manifest string constants are going to be laid out in memory. And it's true that the > operator does not have the same semantics as strcmp() -- it's pointer comparison, as you say, not lexicographic comparison.

So you're right -- it's by no means true on all compilers!

(Reply to this)(Parent)(Thread)

Re: But wait, there's hope!
[info]cuthalion
2008-01-26 01:32 am UTC (link)
I believe the behavior of comparing pointers in two unrelated arrays or objects is actually "undefined".

That said I would expect nearly every compiler on virtually every platform to produce the same results as this.

(Reply to this)(Parent)


[info]chimerically
2008-01-25 11:34 pm UTC (link)
*blink*

(Reply to this)


[info]catamorphism
2008-01-26 01:19 am UTC (link)
Let me guess, did someone link to your post on Digg or Reddit or something? Because the quality of the anon comments suggests that.

My condolences :-)

(Reply to this)(Thread)


[info]paisleychick
2008-01-26 02:17 am UTC (link)
I remember seeing this linked to on reddit.....

(Reply to this)(Parent)(Thread)


[info]oddthink
2008-01-26 04:18 am UTC (link)
Yep, I remember seeing it there, too.

It's amazing how many people seemed to think that they had to explain that this behavior was due to type conversion, as if that wasn't completely obvious. It's as if the question "should this happen?" has never occurred to them.

(Reply to this)(Parent)


[info]nwhitehe
2008-01-26 02:02 am UTC (link)
>>> "zestyping" > "all idiots around the world"
True
>>>


OMFG!

(Reply to this)


[info]whumpdotcom
2008-01-26 03:17 am UTC (link)
An acquaintance had a post linked to by "Fake Steve", the comments went south soon after. I like Ryan Toymako's solution to being picked up by high traffic blogs with rude readers: http://tomayko.com/weblog/2006/12/30/digg-scares-me.

(Reply to this)


[info]rubrick
2008-01-28 11:53 pm UTC (link)
I don't know if from-scratch language design is your thing, but someone really should create 'yourasss'.

(Reply to this)


[info]waymark
2008-01-29 08:00 am UTC (link)
Heh... just try that in VHDL...

Is yourasss object oriented?

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…