I'm currently doing both on my Macbook: I use VirtualBox in Mac OS X to play with different Linux distributions, and use Sabayon Linux on a separate partition for development work. I would say either choice will likely serve. There are, of course, drawbacks to either solution, so here's how I would approach your decision:
- What exactly do you need from your Linux server? You mentioned compilation and debugging -- are you compiling Project Euler assignments or the full Linux kernel? Different projects will require different mounts of processing power. I do Flex development and was able to use the Linux version of Flex Builder 3 (Eclipse-based) in VirtualBox on my Mac. It was a bit clunky at times, but I was able to get some solid work done and didn't have to muck with dual-booting.
- Will you need to crossover between operating systems? This is my primary annoyance with dual-booting. When I develop something in one system, I often want to use it on the other, and have to reboot. Synchronizing two different operating systems on the same hardware is not terribly fun; I could try and mount the drives in each OS, but I've never had good luck with that.
- How hefty of a Linux environment do you need? If you're only going to be using Emacs/Vim for development, can you forgo the X server and just install a terminal-based version of Ubuntu in a VM? Do you need your systems resources to be primarily focused on desktop management? If so, installing on a separate partition (or another hard disk drive, as others have mentioned) will likely be the better option.
- How concerned/prepared are you with/for system maintenance? When I first installed Ubuntu on my Mac (9.04, I believe), I regularly experienced wireless and video issues after kernel updates. Most of the time, these were easily resolved; other times, it was a big pain. I eventually moved to Sabayon because it seemed to support the hardware better than Ubuntu (I was shocked, believe me), but I still have instances where I have to fix my wireless drivers. It's not a big pain, IMHO, but it's still wasted time.
Anyway, to sum up, here's what I would suggest:
If your project won't consume a terrible amount of resources (e.g. large compilation tasks) and doesn't necessarily need a hefty display environment, consider a VM. I really like VirtualBox, but there are other options, of course. This also reduces your need for system administration should a distribution update break compatibility with your hardware, and allows you to stay with in Mac OS X.
If your project will need to consume many resources, requires a hefty desktop environment (e.g. KDE Plasma development :), and needs free reign on your hardware, install it in a separate partition and use rEFIt. As others have mentioned: make sure you install your boot-loader on the same partition as your Linux distribution; doing otherwise risks blowing away Mac OS X (which I learned the hard way :)
One other note, if you pick a VM environment: if you need a desktop environment, consider something lighter than Gnome/KDE. I used Openbox when developing in a VM and it worked very well.