I've been guilty of wearing a baseball hat a lot of the time, but I also slather on the sunscreen, ditto when I wear my bike helmet. Not so in my younger years.
My dad is fighting basal cells on his head, and since that war started, I've started wearing a knock-off Tilly/Boony hat regularly. Mine came from Scouts Canada a few years ago. It's soft, crushable cotton, with a full brim, and has buttons on the sides to pin it up Crocodile Dundee style. It has a generous chin string/lanyard that has come in handy when the wind has kicked up.
Both of my kiddos have army surplus beanies and baseball hats, but they are both terrible about keeping them on their heads, so I keeps lots of sunscreen on-hand and am religious about putting it on them.