The climate of a harbour town is more temperate (i.e., without extremes of heat and cold) than that of a town in a desert at the same latitude. Why?

This is because in a harbour town, the relative humidity is more than in a desert town. Hence, the climate of a harbour town is without extremes of hot and cold.