Two very self-indulgent and snobbish anecdotes:
1: Many years ago I was turned away from the bar at Claridge's Hotel in London. I was dressed correctly. My companion was not. She was wearing trousers and her name was Jeanne Moreau.
2: Certain cruise lines are among the sole survivors of dress codes. I was on a cruise ship about two years ago where the Maitre'D ruthlessly enforced the code, throwing me out of the restaurant for not wearing a tie. I told him that the only hotels in the UK which still enforced a dress code were, to my knowledge, Inverlochy Castle and the Ritz, London. "There's a third," he said, and then named a flea-palace hotel in Scarborough where he used to work. And this ship was full of retired postmen, plumbers, council workers who only went on these ships to wear evening dress. "Well," said one, "Someone has to maintain standards."
However, I must say that I was rather angry at eating at the Michelin starred restaurant in the Lanesborough, London, and wearing a rather 'smart casual' combo and seeing, at the next table, an American couple and he was wearing shorts.He was also drinking Coke.