As with many things regarding computers, there is typically no best answer. It all depends on your situation or requirements.
For backup, CD or Hard drive, it depends on both these.
If you have a large amount of data, then using a hard drive is likely a better choice. For example, I have way too much data for backing up to CD's. It would take way too many and too much time. But if you only have what will fit on a single CD, then that might be a good way to do. Typically you also don't just copy the files there but use a CD Burning program itself.
Also, if data if changed regularly, then backing up to CD's each time this happens is likely to get old fast and not done as often as it should.
If you have files you want to archive that you know you won't be using any longer, then CD's likely are the better choice. For example, many customers have lots of images from digital cameras sorted by year. Each year they just burn everything to a CD (making several copies as well), and then delete them from the hard drive. If you are reasonably careful with CD's they should last quite a while. The jury is still out on exactly how long that would be. If you really want it to last for decades, there are slightly more expensive CD's that can be purchased.