Should I switch the transponder to STBY or not while changing codes?
The FAA started advocating not selecting standby for code changes after it was found that more often than one would expect, the transponder doesn't always come back on after standby.  Seems they uncovered a number of switch failures.

I figure that someone decided that for TCAS it was better to have a transponder squawking any code than not squawking.  But that is my own conjecture.

So for quite a few years the guidance has been to not turn to standby when selecting codes.  

I have had the folks at Flight Safety lecture me after sim sessions, with pretty much the same story.

So I now teach students to just switch the codes, and not standby the transponder.  And I suggest caution when dialing through "7xxx" although controllers I have talked to say it's not a big deal.

So the idea is to keep the transponder squawking, even though numbers are being changed.  There is continuity in that they will continue to have returns while you are playing with the knobs. And if you ever have a switch failure, it will likely be on the ground.

Addendum: Also, with ADS-B, one is supposed to keep the transponder on at all times, when on the airport surface in a movement area. So I can see that the philosophy of managing the standby position will continue to change.

Also note that Bob Gardner's book was from the mid-1990's and things change. Both the transponder technology, the technology, such as ADS-B, TCAS (which also relies on transponders, as well as processing algorithms, which decide how to display transitioning codes.