Depends on how they behave. If they are clearly attack dogs and are not going to stand down, then shoot to kill. It is usually pretty clear what their intentions are especially if they continue to move aggressively towards you. I’ve been around a lot of dogs.
You are wagering a lot on your reflexes. While your life & safety are yours to wager it appears imprudent advice to offer to persons unknown. The downside risk for guessing wrong is horrendous and it’s hard to aim & fire in split seconds. I did not get the impression your advice was predicated on having a gun either.
That being said, your method is what I had used in the past to defuse situations with unknown dogs. That was before the many reports of people being killed by other people’s pets. Now I am more wary.