When you shift the shifter while the bike is still (actually while the crank isn't turning; it doesn't matter if the bike is rolling or not), you force the derailleur against the chain as though it were going to shift. Since it has to be moving to guide onto the next chainring or cassette cog, though, the shift doesn't occur. In theory that can stress the derailleur, especially the rear, though I doubt it actually causes damage in real life. But the chain won't be squarely on the gear, so if you jump on the bike and start pedaling hard, it can jump toward the next gear and either spill you or tweak something. It's probably not as common as it used to be in the friction-shift days, and it's not a huge worry. From years of habit, though, I pick up the rear wheel and give the crank a spin before I get on the bike. If the chain is misaligned, that allows it to hop onto a gear.