A great place for 335i research is on the M3 forums. I go there every once in awhile to read the M3 vs 335i fights lol. You'll find that the 335i's can be made to go M fast with a little $$$, but as the fanboy's keep defending...it's not an M.
As far as 335 vs E39 M5, stock vs stock they're comparable in performance. Interior is nice and although some don't like the newer styling, I do. Modded 335i will walk an E39 M5. But...
Spend $30k on a solid M5 (20k for car and 10k on ESS SC) and you've got the best of all worlds. Styling, performance (low 12's with 550 bhp), V8 grunt and sound, and the M5 will also turn alot more heads and start conversations at gas stations and parking lots than the 335.
It's really about your personality. If you want a smaller fast car there are alot of other choices as well...STI, WRX, M3, etc. Each one will catagorize you into a stereotype. I'm very happy with my stereotype. :wroom: