If I see another student who tells me that the function of a gene is to produce a protein then I think I might scream. So the function of those 30,000 protein coding genes is to produce a protein. Who would have thought it. This sort of tautological nonsense is inspired by a light reading of people like Richard Dawkins. Genes are self-serving, only the gene matters according to them.
Nonsense and garbage they forget that genotype and phenotype are not linearly associated. Gene space and phenotype space do not simply map to one another and the interactions are horrendously complex with many proteins having multiple functions that can depend on space and time. So when I ask what the function of a gene is I expect an inclusive answer not a trite one.