On the class of coding optimality of human languages and the origins of Zipf's law