In front of the computer at home, depends on the temperature and whether or not anyone else is around.
Few like enforced dress codes but a lot also depends on whether or not you interact with people. Your appearance reflects on the company and they pay you so they call the shots. So long as its reasonable and they arent demanding you shell out a huge sum of money for one days attire.
But even without a dress code occasionally the brass comes by, or even the owner, and making a good impression on them can help advance your career. If they are looking to place someone in a more supervisory position you are more likely to get it than someone in the aforementioned Stones t-shirt.