I feel like having to add my 5pens aswell.
Since from your description I feel like I absolutely could be that guy, I'll first tell you what I'm assuming is wrong with your approach, and additional I'm going to give you an advice which might even help you to understand his real intentions, in case his intends are indeed of same source as mine would be.
So, first of all, I can't review his professional knowledge versus yours.
But I'm assuming your presentation of your self here is also biased.
So what if you might be just a little bit too overconfident with your own skills?
All I read so far what you tryed was:
I have tried multiple strategies to deal with this: ignoring it and going about my business, politely but firmly explaining why this person is wrong, asking this person to lighten up, and using humor to point out the ridiculous nature of some of the more nit-picky criticisms.
All this implys him beeing wrong or even is devaluing his thoughts.
But what if actually you were wrong?
Or maybe even no one of you both is wrong and both of you are just expecting each other to have diferent expectations of the discussion as you actually have?
Now let me tell what might actually be the case, as this is what I'm facing not that unfrequent:
I'm developing in C and at some point I even figured that I feel it enjoyable to read standard documents for specifications like programming languages, so it got a hobby of mine to learn the language by its definitions. Some of them are usefull. Some of them are just for specific cases. Some of them are just stupid, but still parts that strictly speaking define the language. Especially the rules designed for special cases are usually simply worked around by compilers so no one has to worry about it. But just because your compiler works around the users potentional lack of knowledge that doesn't mean that it becomes correct, just because it works.
I really like to enlighten others with my efforts I put in learning C as ISO/IEC conform as possible and it is fun for me doing so. Sometimes when reviewing others code, I notify them about something not beeing strictly conform with C. And here 2 situations usually came up, one of them I really enjoy, while the other situation was1 kinda unpleasent for me
So the first option that usually happens:
- the other person started asking about the impact and the reasons why this should be wrong, and a discussion came up where we both finished the arguments with a point where I sattisfied had been able to say, the code is this way nothing diferent from what I had done, but is one of the nasty bordercase tweaks which might on other occassions invalidate the code and the other person thanks for the talk and my effort to improve their knowledge.
and the second is:
- The person feels offended, just starts defending by asking me for a proof of them beeing wrong, since what they do is actually working and doing the job. While here I easily could proof it I just back out since it is not my intention to expose them for being wrong and what I had to learn as previously noted, in that situation there is no chance anymore to explain "Hey I'm just trying to help", as it would just be taken as excuse for exposing them anyway.
Maybe he just isn't at the point that he had learned yet, that some people just don't like to improve their knowledge on spontaneous occuring occassions. And beeing left aside you are or aren't one of those persons, remember if it was me you were talking with, it would have been a friendly gesture and no offense at all.
Also especially your example about the omited space between the equals operator and the operands, makes me feel kinda offended, but I'm sure you had no bad intentions here.
I for example never had anyone seen who defended against my advice to him placing a space there, and even if they kept omiting it, I would tweak on it whenever I had to review their code (and thats no joke either!).
Here I want to add another example:
I'm working in a little startup company which is actually growing in size.
Obvisiously there were no coding policys in the beginning. Our CEO some months ago tasked me for creating such policys, as I especially am verry aware of reserved expressions, signs and keywords of C-language. So I did it, presented it and it got aproved. But yet no one cares about it, and our CEO doesn't bother with enforcing it, while he still had his reasons to task me with it and approving my design, there isn't much I can do about it except reminding others about it. So ofcourse I could just stand up and say " Listen guys! You know the policys I designed? I expect you to strictly respect them from now on and I'll correct your code to be conform with it if you still don't care! ". Our CEO probably would even support that move, but.... Com'on how much of a jerk I would be looking like for my future in that company? So I just keep remembering them if I see them breaking the policy at some point and let it to them, while knowing they had to do it. But it is not my job to enforce it so while it kinda hurts to see own work beeing disrespected in that way, there is not much I can do against it except being the nitpicky dude that ocassionaly rebukes "for not respecting his so called policys".
So that little story from my allday attitude to hopefully help you getting a better understanding of his point and why he might be acting as he acts.
TL & DR:
So what is the conclusion?
I would advise you to try to understand his motivations, while keeping in mind my view of situations that occured to me in my working life.
The way you wrote the OP is in a way that lets you appear, as you're assuming that he is doing so with bad/selfish intentions.
But to solve your problem you should try to figure out first if thats really the case. If he tells you the next time you're wrong, ask him how he would solve this in a better way, try to understand his concerns and you'll probably see, if he really just wants to demonstrate his superiority or he wants to do professional exchange.
If the latter is the case, I guess it will change your view about him anyway.
And if the former should be the case.... Well, than I have nothing to add what not one of the other answers allready advised.
1and I really had hard times in learning to handle that situation, and while I feel I'm doing so meanwhile pretty well, I still feel unconfident when ever this happens.