﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>JC commented on Challenge: What does this code do?</title><description>@Dave - no prob, I just felt like being rude that day :)
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment12</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment12</guid><pubDate>Thu, 31 Jul 2008 19:29:57 GMT</pubDate></item><item><title>Driesie commented on Challenge: What does this code do?</title><description>I've had questions like this on interviews and always feel like saying "if anybody in my team wrote code like this, I'd tell them not to", there's no point ...
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment11</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment11</guid><pubDate>Wed, 30 Jul 2008 10:19:38 GMT</pubDate></item><item><title>Dave commented on Challenge: What does this code do?</title><description>@JC, you're quite right though -- it was a silly thing to do. Note to self: think before pressing submit. Consider my intraweb pass revoked :)
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment10</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment10</guid><pubDate>Wed, 30 Jul 2008 08:56:41 GMT</pubDate></item><item><title>Dave commented on Challenge: What does this code do?</title><description>@JC, 
  
I wasn't trying to amaze. I can't help my lack of innate intelligence, hence I resorted to cheating :) 
  
  
The reason for my comment was that my "without compiling this..." guess was dead wrong. I thought I'd cover the "giving reasons" part of the challenge instead :) . 
  
  
I could have just omitted to mention I compiled it, but wanted to illustrate one key way someone could get the problem wrong. Sorry if I spoiled it for you :-\
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment9</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment9</guid><pubDate>Wed, 30 Jul 2008 06:42:41 GMT</pubDate></item><item><title>Kevin commented on Challenge: What does this code do?</title><description>I suspect it does compile, but I don't care. This code causes any one reading such code to become homicidal and begin searching for the masochist who wrote such code. The reason? My God, if you have to ask .... :-P
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment8</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment8</guid><pubDate>Mon, 28 Jul 2008 15:56:34 GMT</pubDate></item><item><title>Ken Sykora commented on Challenge: What does this code do?</title><description>@Sammy - Because it's not readable... at all :) But that's not the point to this post anyway.
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment7</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment7</guid><pubDate>Mon, 28 Jul 2008 15:54:25 GMT</pubDate></item><item><title>JC commented on Challenge: What does this code do?</title><description>@Dave - "Without compiling this..."
  
  
So amazing that you could run this and come up with the answer.
  
  
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment6</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment6</guid><pubDate>Mon, 28 Jul 2008 14:57:00 GMT</pubDate></item><item><title>Sammy commented on Challenge: What does this code do?</title><description>LOL! Why is that Thomas?
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment5</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment5</guid><pubDate>Mon, 28 Jul 2008 07:27:47 GMT</pubDate></item><item><title>Thomas Eyde commented on Challenge: What does this code do?</title><description>I don't know, and don't care. There should be laws against code like this.
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment4</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment4</guid><pubDate>Mon, 28 Jul 2008 00:21:33 GMT</pubDate></item><item><title>Jeremy commented on Challenge: What does this code do?</title><description>One for the old pen and paper.. It should boil down to 1 + -3 as there are nine negative operators in the expression, the positive operators can be reduced which should make it equivalent to dummyVariable1 + -(-(-(-( -(-(-(-(-(dummyVariable2))))) )))) if I got all the brackets in there correctly or more simply 1 + ---------3 == 1 + -3 = -2. So yes it should have no problem compiling :)
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment3</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment3</guid><pubDate>Sun, 27 Jul 2008 23:40:24 GMT</pubDate></item><item><title>Dave commented on Challenge: What does this code do?</title><description>I had to cheat and fire up the compiler :-\ (feel free to delete this if I'm spoiling the surprise). I guessed no as I didn't realise that + could be a unary operator.
  
  
You end up with dummyVariable1 + (expr), where expression consists of alternating the sign of dummyVariable2  using the unary forms of + and -. It ends up as dummyVariable1 + (-dummyVariable2), or -2.
  
  
I don't want to think about how you came up with this :-S :-)
  
  
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment2</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment2</guid><pubDate>Sun, 27 Jul 2008 23:30:15 GMT</pubDate></item><item><title>firefly commented on Challenge: What does this code do?</title><description>First I thought I will compile but after I look at the MSDN it said "Variables declared by using var cannot be used in the initialization expression" so the last line probably throw an error.
  
  
  
</description><link>http://ayende.com/3457/challenge-what-does-this-code-do#comment1</link><guid>http://ayende.com/3457/challenge-what-does-this-code-do#comment1</guid><pubDate>Sun, 27 Jul 2008 22:56:36 GMT</pubDate></item></channel></rss>