When I go to a coffee shop, I see many different coffees. There are these cheap powdered coffees that don't taste too good, ground coffee, and whole coffee beans. On the internet or in specialty shops, you can find even more types of coffee. What could help me judge coffee quality? For example, I know that with tea the rule of thumb is that bigger, looser leaves are of better quality. Moreover, the first harvest is the most precious one. Do similar rules apply to coffee? What are other general rules that signify better coffee?
This is a fairly general question, so pardon me for a slightly generic answer.
First thing you'll want to consider is the quality of the coffee itself. Typically, the more expensive a coffee is, the higher quality it will be. It's the age old phrase, 'You get what you pay for".
Secondly, the less steps from it being picked to it being in your cup, the better. Packaged, ground coffee has more steps (Packaging, grinding) before being brewed. Whole bean coffee has less.
Third, the longer it's been ground, the longer it has had to degrade. You'll want to grind your whole-bean coffee as close to the time of brew as possible. Oxygen will erode the flavor of the coffee over time. Ground coffee has more surface area to be exposed to oxygen.
I hope this addresses what you were asking properly.
Coffee is at it's heart and agricultural product and suffers from some of the same issues apples do plus some additional ones stemming from it's need to be roasted/stored/ground and brewed before use.
Different strains of arabica beans will produce varied tasting quality similar to the types of apples. However, even the highest quality plants still need to be tended to and grown in the right environment. So farming methods and location play a part.
After a coffee cherry is grown and picked, it must be processed to get at the bean. The fruit must be removed somehow and there are various ways to do this, any or all of which can influence the final flavor of the coffee.
Those beans are then often sorted to create homogenous lots of coffee beans, some folks will claim that this sorting can influence final outcome as well. Assuming the green beans are properly stored and shipped, they arrive finally at a roaster.
A roaster has potentially the most influence on the final outcome. They may blend different lots of beans base on a want for a particular flavor profile (or to save money). And they decide what roast either fits their business model or is best for the beans. The very same batch of beans will produce drastically different cups of coffee (or espresso) based on the roast level. Then there is storage of roasted beans. Some companies grind their coffee before sale, which increases the rate (drastically) at which coffee stales. Others sell the beans whole. These will stale too and the rate depends on storage time and method.
Finally there is the actual method of brewing. There is a myriad of methods, with some new ones even invented in the last decade. Any of which can drastically alter the taste of the final product cup of coffee.
Coffee is such a large industry that there are studies and information out there on each step of the process assuming all other variables the same. One could literally write a book with multiple chapters covering each step of the process. You still wouldn't be able to come up with any definitive answers because the final step is someone's taste buds and we all have different preferences.