﻿<?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>SHODAN commented on An small mistake, just by nine orders of magnitude</title><description>Diego, don't take this the wrong way, but if you code in several languages you still need to know them well enough not to make these kinds of mistakes. That being said, we all make mistakes - mine was probably posting a rude comment. I apologise for that.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment27</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment27</guid><pubDate>Wed, 06 Apr 2011 10:32:59 GMT</pubDate></item><item><title>configurator commented on An small mistake, just by nine orders of magnitude</title><description>@Ryan: Yes, I'm fully aware of that. Like I said, I just *don't care*. When I'm talking about Gigabytes, I don't care about a 7% difference; sure, I care if something is 100GB or 200GB, but I don't give a rat's ass about that third digit.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment26</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment26</guid><pubDate>Wed, 30 Mar 2011 13:39:05 GMT</pubDate></item><item><title>Ryan Heath commented on An small mistake, just by nine orders of magnitude</title><description>@configurator tell that to drive manufacturers :)
  
They usually advertise the base 10 value 
[compreviews.about.com/.../ActualHDSizes.htm](http://compreviews.about.com/od/storage/a/ActualHDSizes.htm)  
  
// Ryan
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment25</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment25</guid><pubDate>Tue, 29 Mar 2011 14:20:50 GMT</pubDate></item><item><title>Ron Klein commented on An small mistake, just by nine orders of magnitude</title><description>That's why I prefer "complex" consts to have the format of:
  
int const Kilo = 1000;
  
int const Mega = 1000 * Kilo;
  
int const Giga = 1000 * Mega;
  
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment24</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment24</guid><pubDate>Tue, 29 Mar 2011 11:43:11 GMT</pubDate></item><item><title>configurator commented on An small mistake, just by nine orders of magnitude</title><description>@Ryan: I couldn't care less. When talking about file size it may be "correct" to consider a gigabyte as 1000000000 bytes, but it is standard to consider a gigabyte as 1073741824 bytes.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment23</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment23</guid><pubDate>Tue, 29 Mar 2011 11:00:03 GMT</pubDate></item><item><title>Ryan Heath commented on An small mistake, just by nine orders of magnitude</title><description>@configurator minor nitpick, according to the variable name 'giga', the ( intended) value 1.000.000.000 is correct. 
  
  
1 &lt;&lt; 30 == 1 GB (GiB) == 1.073.741.824 bytes.
  
Just as kilo equals 1000. 1 KB (KiB) equals 1024 bytes.
  
  
// Ryan
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment22</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment22</guid><pubDate>Tue, 29 Mar 2011 10:40:58 GMT</pubDate></item><item><title>Manu commented on An small mistake, just by nine orders of magnitude</title><description>@Diego, I believe ** would clash with pointer multiplication
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment21</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment21</guid><pubDate>Tue, 29 Mar 2011 10:38:27 GMT</pubDate></item><item><title>Louis Hau&amp;#223;knecht commented on An small mistake, just by nine orders of magnitude</title><description>+1 for @configurator. 
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment20</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment20</guid><pubDate>Tue, 29 Mar 2011 09:58:25 GMT</pubDate></item><item><title>James commented on An small mistake, just by nine orders of magnitude</title><description>@hazzik
  
  
Testing only proves the presence of bugs not their absence.
  
  
- Dijkstra
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment19</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment19</guid><pubDate>Tue, 29 Mar 2011 05:20:27 GMT</pubDate></item><item><title>Brian commented on An small mistake, just by nine orders of magnitude</title><description>@hazzik, You might consider reading:  How to Win Friends &amp; Influence People
  
  
Unless, of course, you're trying to influence us to consider you in a less than stellar way.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment18</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment18</guid><pubDate>Mon, 28 Mar 2011 22:11:51 GMT</pubDate></item><item><title>hazzik commented on An small mistake, just by nine orders of magnitude</title><description>Write the unit tests first, idiots!
  
TDD in your ass!
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment17</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment17</guid><pubDate>Mon, 28 Mar 2011 21:14:54 GMT</pubDate></item><item><title>configurator commented on An small mistake, just by nine orders of magnitude</title><description>I prefer 1 &lt;&lt; 30. It's quite clear (everybody knows 1 &lt;&lt; 10 is kilobyte) and I find it clearer because you have 10 for each prefix (10 = kilo, 20 = mega, 30 = giga, etc. - easier for me than 3, 6, 9).
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment16</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment16</guid><pubDate>Mon, 28 Mar 2011 20:40:11 GMT</pubDate></item><item><title>Harry Steinhilber commented on An small mistake, just by nine orders of magnitude</title><description>@Juan, the only problem with the '1e9' notation is that it produces a double. Ayende's constant was an int, so it would require an additional explicit cast. Not terrible, but it does end up messing with readability.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment15</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment15</guid><pubDate>Mon, 28 Mar 2011 18:25:00 GMT</pubDate></item><item><title>Christopher Bennage commented on An small mistake, just by nine orders of magnitude</title><description>@Jason - readability
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment14</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment14</guid><pubDate>Mon, 28 Mar 2011 17:30:21 GMT</pubDate></item><item><title>Christopher Bennage commented on An small mistake, just by nine orders of magnitude</title><description>Ha! I totally would have made that mistake. :-P
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment13</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment13</guid><pubDate>Mon, 28 Mar 2011 17:29:09 GMT</pubDate></item><item><title>Andrew Skalkin commented on An small mistake, just by nine orders of magnitude</title><description>Two minutes of blankly staring at the snippet and finally the facepalm moment :)
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment12</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment12</guid><pubDate>Mon, 28 Mar 2011 15:21:08 GMT</pubDate></item><item><title>Martin Larsen commented on An small mistake, just by nine orders of magnitude</title><description>Jason, the compiler optimizes away the calculation as it is a const value.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment11</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment11</guid><pubDate>Mon, 28 Mar 2011 14:54:41 GMT</pubDate></item><item><title>Juan Lopes commented on An small mistake, just by nine orders of magnitude</title><description>That's why I prefer the "1e9" notation.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment10</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment10</guid><pubDate>Mon, 28 Mar 2011 14:51:34 GMT</pubDate></item><item><title>Jason commented on An small mistake, just by nine orders of magnitude</title><description>Isn't this an ugly way to do things regardless - why calculate the value every time? Why not just use const int giga = 1000000000?
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment9</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment9</guid><pubDate>Mon, 28 Mar 2011 14:35:06 GMT</pubDate></item><item><title>Remco Ros commented on An small mistake, just by nine orders of magnitude</title><description>I'm going back to school. . . . ^-^
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment8</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment8</guid><pubDate>Mon, 28 Mar 2011 13:57:20 GMT</pubDate></item><item><title>Diego Mijelshon commented on An small mistake, just by nine orders of magnitude</title><description>Shodan, if you code in more than one language (I assume you've read C# for dummies, but not VB for morons, nor Haskell for idiots), it's not hard to use the wrong operator.
  
In that regard, C# is behind other modern languages for not having an exponentiation operator (which could just be an alias for Math.Pow), which is more useful for high-level development than XOR (and they could have used **, which doesn't clash with anything)
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment7</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment7</guid><pubDate>Mon, 28 Mar 2011 13:45:43 GMT</pubDate></item><item><title>SHODAN commented on An small mistake, just by nine orders of magnitude</title><description>If you take that long to spot the problem, you need to read some C# for dummies books.
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment6</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment6</guid><pubDate>Mon, 28 Mar 2011 12:34:15 GMT</pubDate></item><item><title>Peter Morlion commented on An small mistake, just by nine orders of magnitude</title><description>Also had to enter it in VS before I got it. Even then, had to double-check MSDN :D Learnt something new today!
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment5</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment5</guid><pubDate>Mon, 28 Mar 2011 12:18:41 GMT</pubDate></item><item><title>Ales commented on An small mistake, just by nine orders of magnitude</title><description>Same as Martin :-) but takes 15 mins :-D
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment4</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment4</guid><pubDate>Mon, 28 Mar 2011 12:09:03 GMT</pubDate></item><item><title>Martin Larsen commented on An small mistake, just by nine orders of magnitude</title><description>Hehe.. I actually spent 10 minutes staring at that snippet before realising what was wrong. :-)
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment3</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment3</guid><pubDate>Mon, 28 Mar 2011 11:44:29 GMT</pubDate></item><item><title>Lee Atkinson commented on An small mistake, just by nine orders of magnitude</title><description>A VB programmer in a pass life, perhaps?
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment2</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment2</guid><pubDate>Mon, 28 Mar 2011 11:31:01 GMT</pubDate></item><item><title>Patrick Huizinga commented on An small mistake, just by nine orders of magnitude</title><description>At first I thought it would be interpreted as if ( (copiedStream.Length &gt; 1) * Giga)
  
  
But then I realized the compiler would give an error (about bools, ints and ifs).
  
  
And when I entered the above piece of code in VS, I was quite surprised about the actual error. :)
</description><link>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment1</link><guid>http://ayende.com/4794/an-small-mistake-just-by-nine-orders-of-magnitude#comment1</guid><pubDate>Mon, 28 Mar 2011 10:40:31 GMT</pubDate></item></channel></rss>