It is always best to choose whole coffee beans ...
Beans stay fresher for longer, and so your coffee should taste better, too.
As soon as green coffee beans are roasted, they start to release CO2, which affects the taste. They will oxidise and slowly start to go 'stale' and have a flat taste after a while. When coffee is ground, there is a higher surface area which is exposed to oxygen and that will cause them to lose their freshness faster, so it's best to keep coffee beans whole as close to brewing as possible. Treat your coffee beans similarly to potatoes: store them in a dark, dry place. It's best they are kept in a container or the bag they come in to stop oxygen and moisture getting in.