|Dealing with glasses is simple enough if you follow the basic rule.|
There's a simple enough rule which is that you have to ensure that the reflected light is not 'pointing' towards the camera. If you consider on-camera flash then the flash light is on the same axis as the camera and so any reflections are reflected back straight to the camera. That's just about the worst kind of light anyway, resulting in flat lighting and those dreaded highlights in the glasses that mean we don't get to see the subject's eyes.
Here's the lighting diagram for the shot at the top of the post...
So, although the light is on the same vertical axis as the camera, the light sources are effectively above and below the camera which, critically, means that the light will not be reflected into the lens. You can see how the lighting has given us highlights on the frames of the glasses which gives them some definition, but as the light is above and below, the other advantage is that we do not have shadows from the frames running across the face.
If you're taking a photo of someone wearing glasses, don't use on-camera flash! In fact, available light would almost certainly be much better, but however you light the subject, think about where the reflected light will be going and make sure it's not back into your camera lens.