It's easier to change settings on the D50. It also supports autofocus on all Nikon AF D and G lenses, whereas the D40 doesn't support autofocus on AF lenses (weird, I know) unless the lens is an AF-S lens. In other words, the D40 only supports lenses with the newer, faster, quieter AF. The D50 can support AF and AF-S, and changing settings is quicker because it's on the body.
I spent a total of around 30 minutes with the D40 in Japan (there were around 4 on display, each with a different lens), and while I found it easy to change settings on the D40, it's also slower because of the menu system it uses.
However, if you plan on buying the Nikon D40 with the kit lens, and maybe only 1 (possibly 2) lenses down the road, all of which have AF-S, then the D40 isn't bad at all.
The D40's viewfinder and LCD are much better than the one on the D50, including the brightness and viewing angle of the LCD. All of this, plus support for SDHC are the only decent reasons to consider the D40 over the D50.
I'd buy the D50, but it really depends on how you plan on using the D40. The D40 has a market, but you may not be a part of the target market if you plan on getting really into it and buying a lot of the AF lenses that are still in Nikon's lineup, such as the 50 mm f/1.8 that people here keep recommending. Well that, and many of the 3rd party lenses from Sigma, Tamron, and Tokina.