Both share the quality of decreasing the level of light entering your eyes (hats, by reducing your field of vision).
I was a huge fan of hats until I noticed the effect, which is limited to brimmed hats.
(Also consider social conventions about hats and their similarities to conventions about sunglasses. And consider the conventions themselves and how they would tie into these effects.)
Both share the quality of decreasing the level of light entering your eyes
Actually, no, that's not the important thing. Dark sunglasses hide your eyes, in particular their expression and direction. It's harder for other people to gauge you -- that's what provides the "sheltered and protected" feeling.
As to social conventions, I believe the ones about hats go back to showing trust (or submission) by making yourself vulnerable to attack.
For years, I've taken being a classic nerd, geek, and hacker as a point of pride - eg, consciously trying to judge people by the code they produce, or whatever else they write, as opposed to judging them on their appearance, to the point that I prefer /not/ to know what my favourite authors look like. I've tried to make what strengths I can out of the resulting weaknesses, such as reducing decision fatigue by keeping a single hair-style for many years, wearing whichever t-shirt is on top of the clean shirt pile, and so on.
I'm no longer satisfied with this. I want to become stronger.
Last month, I bought a dozen button-up, collared shirts... and have noticed slight, but consistent changes in my workflow when I wear them. I want to leverage whatever other clothing-based self-improvements are within my budget.
For some years, I've worn a floppy boonie hat to shade my delicate eyes from the burning rays of the sun. (I've even been seen wearing it with a photographer's vest instead of a daypack while tromping around my hometown.) I'm thinking of trying out the 'Crasche' safety inserts mentioned in the recent Open Thread while hiking far from medical help, which would require a baseball-like cap with a sweatband. Given my proclivity for taking something that works and sticking with it for years, I might be wearing that cap for a very long time.
Thus, a multi-layered question: Which hat should I buy? Which factors should I take into account... and which shouldn't I? Are there any subreddits, forums, or other online discussion groups whose members would be willing to take this question seriously and with only a minimum of mockery?