<p>I was recently working with a <code>DateTime</code> object, and wrote something like this:</p>

<pre><code>DateTime dt = DateTime.Now;
dt.AddDays(1);
return dt; // still today's date! WTF?
</code></pre>

<p>The intellisense documentation for <code>AddDays()</code> says it adds a day to the date, which it doesn't - it actually <em>returns</em> a date with a day added to it, so you have to write it like:</p>

<pre><code>DateTime dt = DateTime.Now;
dt = dt.AddDays(1);
return dt; // tomorrow's date
</code></pre>

<p>This one has bitten me a number of times before, so I thought it would be useful to catalog the worst C# gotchas.</p>

I saw this one posted the other day, and I think it is pretty obscure, and painful for those that don't know
```
```
int x = 0;
x = x++;
return x;
```
```
As that will return 0 and not 1 as most would expect