When I was young my boss pointed out to me that I needed to get a thicker skin if I was to remain in that business. He was right. No one in business can afford to get upset over such things. You need to stop getting upset at the idea of his making fun of you and concentrate on meeting his expectations so that he has nothing negative to say. It seems he has valid concerns to me. Deadlines come faster in the real world and you need to work faster than you might be used to. Not following coding standards and silly mistakes need to be fixed. Making the same mistake more than once is frowned on. Making the same mistakes repeatedly after being told to fix them is grounds for dismissal.
So you need start to listening to what he says. That means changing your behavior and that means not wasting time being upset at your boss's perception of you and spending more time on fixing that perception. Right now, you may be surprised to learn that your performance is clearly not adequate by your boss's standards (which are the ones that count in performance evaluation). If you don't fix it, you may be surprised to learn that you have been fired.
You also need to understand that the workplace contains plenty of people who are not going to worry about your feelings in how they communicate. They are concerned about the work product, not you. You need to be able to work with people you dislike, you need to be able to work with people you feel are not competent and you need to be able to work for people who are organizationally superior to you including making the performance changes they request whether you agree with them or not.
You also clearly need to learn to talk to your boss. If you feel he is being unfair to you, you need to address that directly to him not some strangers on the Internet. You need to hear what he has to say in response. Do this in private.
Then you need to fix the problems he brings out. There is nothing wrong with telling him in private that you feel made fun of when he says these things. But don't expect huge changes either. Not until you fix what he is upset with you about. He will likely treat you with more respect when he feels as if you deserve respect. Yes the better bosses do not usually treat people this way, but the better bosses also don't tolerate poor performance for very long because they know how it affects the projects and the morale of the other workers who are carrying the load for the poor performer.
You also might consider that by saying this in a joking manner it is possible that he was trying reduce the sting of his criticism (clearly not, in your case, very effectively). So maybe instead of making fun of you as you think, maybe he was using a little humor to save face for you, but still get his point across. If you assume that people are trying to help but just didn't say it right, you might find the workplace easier to navigate than if you take things personally. They often are not meant personally. Atrribing better motives to people or realizing that some times something not at all related to you (like personal stress) can cause someone to be less than kind in communication. Give people the benefit of the the doubt and you will be much happier in the long run.
It may not seem fair that he treats you this way, but life is not fair.