Publicly i.e. I front of the team? No. It serves no purpose than to stroke some egos and reduce the "Overton window" of development discussion and experimentation.
To me the one2one situation would feel like I’m surreptitiously getting bollocked for making the mistake, under the guise of humor. In public, on the other hand, I don’t care if someone takes the piss out of my code - I’ll laugh right along with them as long as it’s not overly malicious. IMO it sets a good example not to be precious about your code.