Retina Macbook Pro 15" 2015 vs iMAC 21" 3.1 GHZ i7 256 SSD
I find that the flexibility of being able to move around in the house makes it worth getting a laptop. Mobile freedom is really addictive once you get used to it. The only issue is that, for coding, having a ton of screen real-estate is advantageous. Obviously the iMac has the MacBook Pro beat in that regard, but you could get a cheap external display for that purpose. It depends on which setup you'd find yourself most comfortable with. Sometimes, if I'm just writing a Python script with no UI, I can easily do it with one monitor, and so then the mobile freedom offered to me by my laptop is incredibly nice. The other times, I have a cheap external monitor for my UI, and my MacBook Pro's monitor for the code, since it has such a high res display to make all the text crystal clear. The UI monitor doesn't have to be terribly high-res, just large. It works well for me.