I can't speak enough about the iMac. It's a great computer. It's nearly the very best computer except for one thing: people desire portability over function. But let's ignore that for now, or let's assume we're all rich enough to afford an iMac and a MacBook. I want to focus on the awesomeness of the iMac.
It's all about that screen. The highest resolution, 27-inch, precision color display you should only be able to dream of. It's amazing. Part of the reason this is so under appreciated is that most buyers don't have the technical ability to understand its greatness. Most computer nerds, while they think they do, also don't have the ability. The screen makes the iMac one of the best professional computers available, at a non-professional price.
iMacs last forever. They will always last beyond when you are still practically able to use them, and if you don't mind falling behind in current software, just keep using it. I have an iMac from 2006 (the first Intel iMac) that still runs on my network.
And there's one good approach to iMacs that works for those with reasonable means. Alternate between buying a MacBook and an iMac and you will have a reasonably updated version of both.