Most of what follows was kindly provided by Ian Carr (1942-'51):
To promote a sense of competition and loyalty amongst the boys, around 1927 the pupils were grouped into conceptual 'Houses', as was quite usual at grammar schools. Each House had its own colour which was the colour of a stripe in the school uniform tie and a button on the top of the uniform cap.
Initially there were three houses: Hardy (yellow), Lock (black) & Pope (blue). Treves (green) was added some time later. Treves comprised all the boarders at that time (Southwalks & Southfield) plus some dayboys to give even numbers - about 110 per house.
Sometime around 1948, it was felt logical to group all the boarders exclusively into one house, so two new houses were created: School (silver) and Hodges (red). All the boarders were transferred to School House; Treves became all dayboys, as was Hodges. Each house now had about 75 boys.
The house-name 'School' later evoked an invidious identification of one house with the whole school. Boarders were also thought to have a permanent-residency advantage - both academically and athletically; some pupils became boarders to avoid the travel-time and enhance their academic performance.
In 1951, Heathcote House opened, thereby increasing the number of boarders at the school, which would have made School House much larger than the others. Also, with the school changing its name from Dorchester Grammar School to Hardye's School, it was felt that the House names 'Hardy' and 'School' were no longer suitable. Consequently, School & Hardy houses were abolished. The dayboys of Treves & Hardy were redistributed amongst Hodges, Lock & Pope. Treves became all boarders and assumed the silver tie stripe; yellow & green were dropped.
In 1958, Lock House changed its colour from black to yellow, and green ties were reintroduced to be worn only by those who had been awarded School Colours in sports.
In 1971 Williams House was added with green as its colour, so (presumably) the School Colours green tie concept was dropped.