I think dress code is up to the wearer unless dictated by the establishment.
I'm 56 and although semi retired have no problem with wearing a suit and tie still!! with the tie done up properly!! I suppose its how we were brought up as well. My father worked as a fitter in a factory but always wore a tie. He used to say he felt undressed without it.
I always wear trousers, smart or casual summer, and a shirt in the evenings even just out for drinks, sometimes I have even worn a tie but that was some years ago. Its just the way I feel for myself and as my wife would dress up to go out, as Pollensa said, she would not like me to be in shorts and t-shirt.
It can also be a conforming sort of situation, short wearers obviously have plenty of confidence in there appearance, whereas some would need to conform to a supposed "code" to feel comfortable, to fit in.
Often a dress code is enforced to encourage a particular type of behaviour, like uniform at school. Clubs often have a dress code eg no jeans/trainers etc because they are trying to reduce the possibility of bad behaviour.
There is also a snobbish attitude to dress where they mistakenly assume poor behaviour is associated with more casual dress. Shell suits or Football shirts for instance can be, rightly or wrongly, associated with the behaviour of yobs at a football match, a small minority spoils the reputation of the many.
Modern fashion is weird to me now, just as my teenage fashion was weird to my parents.
My advice is be comfortable, be tolerant, be considerate, be courteous, behave as you would wish others to behave and have a great time.
