I've taught in schools with a dress code and with a uniform. The uniform is much better, so long as it is modest and appropriate to two sexes. Having a dress code resulted in as many personal interpretations as there were parents sending their children to the school. Every time a new fashion fad arose, it would somehow appear at school regardless of how the dress code was worded. For the staff and faculty, and sometimes parents and school board, there were endless meetings and continual controversy. Such a waste of time!
The school at which I presently teach has two uniform sets, one for males, one for females. That includes uniforms for p.e. There are very specific rules for hairstyles, Jєωelry, and make-up. (No make-up unless for medical reasons, ie, a girl with a facial disfigurement is permitted to cover it.) It may sound a bit like North Korea, but it certainly eliminates a host of problems so that one may concentrate on education.