How to Make The Perfect Cup of Coffee
Making the perfect cup of coffee is more than simply buying any old beans from the store and dumping them into your paper-filter drip coffee machine. While the two biggest factors affecting a good cup are recency of roasting and recency of grinding, there are other things to consider. How you make your coffee will also have an effect, as well as where the coffee originates from and what level of roast you get.
Fresh Roasted Coffee
Getting coffee that has been roasted recently is arguably the #1 factor in making a good cup. When a coffee is roasted it begins releasing CO2 and the flavour begins to disappear within days or weeks. It's best to get coffee that has been roasted within just a few days, and hasn't been sitting on a store shelf for weeks or months.
The process with most store-bought coffee is one of roasting, bagging and sitting in inventory for a day or two, shipping for 3-4 days, sitting in a warehouse/distribution facility for up to 7 days, shipping for another 1-2 days, then finally sitting on a shelf until someone comes along and buys it. The fresh products are usually shoved towards the back of the shelves so that the older products can go out first. That means you're looking at generally 2 weeks (or sometimes much more) from the time the coffee is at it's peak flavour, to the point you actually get to consume it.
Freshly Ground Coffee
While coffee begins losing flavour quickly after roasting, the effect is much more pronounced when it's ground as well. Ground coffee loses the majority of it's flavour within a couple days to a week from the time it's ground, making it vital to at least grind your coffee yourself (or when you buy it) if you're buying it pre-roasted.
Home grinders have grown in popularity as people learn how to better enjoy that cup of coffee they need to get going. Some machines (like semi-automatic espresso machines) have built in grinders so that the beans are ground within seconds of being brewed.
Your best bet is to find a small scale coffee roaster near you that will roast your coffee to order, and have a grinder at home to grind up your whole coffee beans.
Coffee Roast Level
Certain coffee beans will survive better under darker roasts, and some may even reach their peak flavour with a light/medium roast. It depends entirely on the climate and growing conditions of the beans, and isn't something that can be easily predicted. Master coffee roasters are familiar with different green coffee bean origins and at what point they've reached their maximum flavour, then it's up to them to get as close to that with their specific batch.
Like all agricultural products (think of wine for example), the end product you consume can only be as good as the product you start with, and the product quality can vary from season to season. The same is true with coffee. Although a Kona coffee will generally be more sought after than a Colombian coffee, they can each have good years and bad years.