p2pkh vs. p2pk keeping public key private I just got into learning Bitcoin programming through Jimmy Song's Programming Bitcoin.
Jimmy says that some of p2pkh's advantages over p2pk include:

a smaller ScriptPubKey

keeping one's public key private


I completely agree with the first advantage but I'm having a little trouble with the second advantage.
Jimmy explains that, if ECDSA was every broken, one could steal bitcoin from another entity because they could find their public key in the ScriptPubKey (if they were using p2pk) and create a valid signature.
My question is: If all we are doing is moving the public key from the ScriptPubKey to the ScriptSig, what security does that grant us if the ScriptSig is also accessible? If I was to spend a UTXO that was made to my public key hash, my public key would be public. Couldn't a malicious user who had broken ECDSA keep looking for a UTXO ScriptPubKey with my hash in it, copy my public key from the previous transaction, generate a signature, and steal my bitcoin? It seems to me that my public key is private as long as I don't spend anything.
Of course, I know I'm missing something :) Any help is appreciated.
Bitcoin addresses, and the public key by extension, should ideally only ever be used once. So your time of exposure of the public key in P2PKH  is the time between when the spend is made and when it confirms. For P2PK the public key is always known to everybody. There's a considerable difference between the two.