How does cooking with whole peppercorns compare to ground?
For freshness, it is always best to purchase whole spices and use whole, crack, or grind them as needed. With respect to peppercorns (or, really any whole spices) the effect will be different when they are used whole, just cracked, or ground.  The flavor will also be impacted by toasting the spices before use, and when they are added during the cooking process.  The taste difference between all of these options can be significant.  The bottom line is that you should have some idea of the effect you are trying to create with the spice, and how the treatment of that spice achieves the result you are looking for.