POV-Ray : Newsgroups : povray.off-topic : Today's WTF moment Server Time
1 Nov 2024 07:25:29 EDT (-0400)
  Today's WTF moment (Message 1 to 8 of 8)  
From: Orchid Win7 v1
Subject: Today's WTF moment
Date: 11 Jan 2014 12:42:57
Message: <52d182a1$1@news.povray.org>
I just stumbled across this on Stack Overflow:

   while (x --> 0)

(This is C++, in case that wasn't clear. It probably works in C too, I 
would imagine...)

The question, naturally, was asking what the hell the "-->" operator 
does. The answer is... well, it's completely logical. But this still 
leaves me wondering who THE HELL wrote this code snippet in the first 
place?? They could so trivially have made its meaning clearer...

I guess every programming language has dark corners where you can do 
really strange stuff. But the question is usually "why would you do that?"


Post a reply to this message

From: posfan12
Subject: Re: Today's WTF moment
Date: 11 Jan 2014 19:26:25
Message: <52d1e131$1@news.povray.org>
On 1/11/2014 12:43 PM, Orchid Win7 v1 wrote:
> what the hell the "-->" operator does

What the hell does the "-->" operator do?


Mike

-- 
http://isometricland.net

---
This email is free from viruses and malware because avast! Antivirus protection is
active.
http://www.avast.com


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Today's WTF moment
Date: 12 Jan 2014 05:12:14
Message: <52d26a7e$1@news.povray.org>
On 12/01/2014 12:25 AM, posfan12 wrote:
> On 1/11/2014 12:43 PM, Orchid Win7 v1 wrote:
>> what the hell the "-->" operator does
>
> What the hell does the "-->" operator do?

There is no spoon, and it is really you that bends.

Wait, what where we talking about? Oh yeah...

Apparently, the expression

   x --> 0

is actually parsed as

   (x--) > 0

Now of course, it should be obvious what it does. Indeed, if the author 
of the original code had written it that way, this question would never 
even have been asked!

There's a whole seam of similar questions on Stack Overflow - e.g., what 
does "&&&" do? It turns out that by mixing up binary and unary operators 
without spaces, you can CONFUSE THE **** OUT OF PEOPLE!


Post a reply to this message

From: Doctor John
Subject: Re: Today's WTF moment
Date: 12 Jan 2014 08:08:20
Message: <52d293c4@news.povray.org>
On 12/01/14 10:12, Orchid Win7 v1 wrote:
> On 12/01/2014 12:25 AM, posfan12 wrote:
>> On 1/11/2014 12:43 PM, Orchid Win7 v1 wrote:
>>> what the hell the "-->" operator does
>>
>> What the hell does the "-->" operator do?
> 
> There is no spoon, and it is really you that bends.
> 

:-D

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Today's WTF moment
Date: 12 Jan 2014 08:18:10
Message: <52d29612$1@news.povray.org>
>>> What the hell does the "-->" operator do?
>>
>> There is no spoon, and it is really you that bends.
>>
>
> :-D

In other news, during my job interview I actually uttered the phrase 
"one does not simply walk into Mordor". This is apparently part of the 
reason they hired me...


Post a reply to this message

From: clipka
Subject: Re: Today's WTF moment
Date: 12 Jan 2014 10:19:48
Message: <52d2b294$1@news.povray.org>
Am 12.01.2014 14:18, schrieb Orchid Win7 v1:
>>>> What the hell does the "-->" operator do?
>>>
>>> There is no spoon, and it is really you that bends.
>>>
>>
>> :-D
>
> In other news, during my job interview I actually uttered the phrase
> "one does not simply walk into Mordor". This is apparently part of the
> reason they hired me...

... which may well be. Throwing LotR quotes in a job interview is 
usually indicative of being relaxed, which in turn is usually indicative 
of not hiding anything that might negatively affect your qualification 
for the job.

(Then again, it might also be indicative of incompetence-hiding 
competence; but by definition there's no way to find out whether that's 
the case.)


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Today's WTF moment
Date: 12 Jan 2014 10:38:56
Message: <52d2b710$1@news.povray.org>
>> In other news, during my job interview I actually uttered the phrase
>> "one does not simply walk into Mordor". This is apparently part of the
>> reason they hired me...
>
> ... which may well be. Throwing LotR quotes in a job interview is
> usually indicative of being relaxed, which in turn is usually indicative
> of not hiding anything that might negatively affect your qualification
> for the job.

As the only person in the building who knows the difference between a 
binary search tree and a binary heap tree, I think it's important to 
show that I also have a sense of humour. ;-)


Post a reply to this message

From: andrel
Subject: Re: Today's WTF moment
Date: 12 Jan 2014 15:38:30
Message: <52D2FD44.4060505@gmail.com>
On 12-1-2014 16:39, Orchid Win7 v1 wrote:
>>> In other news, during my job interview I actually uttered the phrase
>>> "one does not simply walk into Mordor". This is apparently part of the
>>> reason they hired me...
>>
>> ... which may well be. Throwing LotR quotes in a job interview is
>> usually indicative of being relaxed, which in turn is usually indicative
>> of not hiding anything that might negatively affect your qualification
>> for the job.
>
> As the only person in the building who knows the difference between a
> binary search tree and a binary heap tree,

Ok smartass, which type of tree was Treebeard?

> I think it's important to
> show that I also have a sense of humour. ;-)


-- 
Everytime the IT department forbids something that a researcher deems
necessary for her work there will be another hole in the firewall.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.