Glasses are a crude human technology. Normally, they are intended to enhance eyesight when the wearer suffers from an optical deficiency. (Humans have not developed a successful method of replacing inefficient optic organs, and their repair techniques are as yet too expensive for common use.) Other humans wear glasses to limit the overly intense light from the Sun, or simply to look "cool". Humans are a very strange species indeed.
Chip Chase, in keeping with his nerd identity, wears glasses. That guy's got bad legs and bad eyes. Some people just can't catch a break.
Archibald Amundsen Witwicky wore glasses at the time of his expedition to the Arctic. When he discovered Megatron, the Decepticon burned the location of the All Spark onto Witwicky's glasses (which also had the effect of driving him blind and insane). Over a century later, his descendant Sam tried to sell the glasses on eBay.