Lineage-based mechanisms are widely used to generate cell type diversity in both vertebrates and invertebrates. For the past few decades, the nematode Caenorhabditis elegans has served as a primary model system to study this process because of its fixed and well-characterized cell lineage. Recent studies conducted at the level of single cells and individual cis-regulatory elements suggest a general model by which cellular diversity is generated in this organism. During its developmental history a cell passes through multiple transient regulatory states characterized by the expression of specific sets of transcription factors. The transition from one state to another is driven by a general binary decision mechanism acting at each successive division in a reiterative manner and ending up with the activation of the terminal differentiation program upon terminal division. A similar cell fate specification system seems to play a role in generating cellular diversity in the nervous system of more complex organisms such as Drosophila and vertebrates.