>>299765D40 because nikon lenses are cheaperCanon lenses are generally less expensive than a similar Nikon lens. Not by much, no, give or take $100, and it swings both ways.
>> and the D40 works with more legacy equipment that is cheaply found on ebay.Depends on what you define "works" as. Yeah, it'll mount on it alright. Except you have no autofocus and no metering.
Get yourself a screw mount adapter for a EF Canon and there you go, you just got the exact same thing, plus it'll even meter properly!