Perhaps it really is just an accessory for style, but there are also many hikers who rely on sunglasses for protection and to fight the fatigue of sunlight on their eyes. The cheapest plastic sunglasses can be constructed to sufficiently block out the harmful ultraviolet rays from the sunlight and the lenses can protect against any small objects that may threaten eye safety. However, the price range for quality, scientifically engineered protective eye wear can shoot into the hundreds of US dollars. These include high carbon and other composite materials that withstand high impact forces. The lenses would be made of strengthened fiber or polycarbonate for light weight and great strength. The benefit of that particular material is that it is transparent, that it does not shatter when it is broken, and it has great inherent UV protection. They can be made into many practical yet fashionable designs, such as the popular wrap-around style.
The actual practical utility for sunglasses in the outdoors
while hiking is the shield the eyes from sunlight and projectile objects. At
higher elevations the atmosphere thins out along with the level of protection
that we normally get from rays of the sun. The intensity of the full spectrum
of sunlight increases as the thickness of the air and the pollution decreases,
and it can cause fatigue and even damage much quicker than normal in the lowlands.
Just as you get a sunburn quicker at high elevations, so can you damage your
vision due to the same causes. In the special circumstances where you're hiking
far above the shade of the tree line and you reach the white, snowy expanses
of the ice fields, proper sunglasses are an absolute necessity. The effects
of the intense sunlight are further reflected back up by the snow and ice,
and it is much more than the eyes can naturally withstand. After as little
as 20 minutes the retinas will be damaged and will begin to ache and later
lose function. Unless the eyes are soon protected that will lead to permanent
blindness, but at the very least you will get temporary snow blindness. You
will need to wear sunglasses (or glacier glasses) with full coverage and strong
protection to keep your eyes healthy.