Are you going to regularly take your car to the race track?
Yes -> M3
No -> 335i
The 335i is 80% of what you get from the M3 in terms of fun behind the wheel. Stock. Upgrades to suspension and a tune can perhaps up that number to 90%.
The M3 has much sharper responses, improved looks, but comes at a premium that is beyond justifiable (IMHO) all the while having some no-BS shortcomings against the 335i (torque, fuel economy). For a $20k premium, the M3 should not feel down on low-end punch in comparison to its garden variety little brother.
I've driven the 335iS with DCT and honestly that is the most fun I've had in a BMW since the e46 days. Combine that with M3's "m mode" steering responses and you have a winner. F30 M3 should be a blast.