Transcription factors regulate the molecular, morphological, and physiological characters of neurons and are responsible for their impressive cell type diversity. We used single-cell sequencing to access the transcriptomes of all neurons in the Drosophila optic lobes and used machine learning to identify transcription factors that regulate neurotransmitter identity, which we verified genetically. We showed that the same terminal characters are regulated by different transcription factors in different cell types, arguing for extensive phenotypic convergence. We found that neurotransmitter identity is established days earlier than it is being implemented. To understand the first steps of neuronal identity acquisition, we sequenced young and old neurons during larval stages and established a timeline of expression of the different effector gene modules. We are also comparing the cell type composition in the brains of different insects to understand how neuronal diversity evolves. Collectively, our data provide a deep understanding of the developmental and functional specification of a complex brain structure and testable hypotheses about its evolutionary history.