Reptiles are classified according to the position and number of openings in the skull, called temporal fenestras.
Subclass Anapsida: no opening, (primitive reptiles and turtles)
Subclass Diapsida: 2 openings, (snakes, lizards, crocodilians, dinosaurs, pterosaurs, tuatara, nothosaurs, plesiosaurs and icthyosaurs etc.)
Subclass Synapsida: one low opening, (pelycosaurs, therapsid mammals such as dicynodonts, cynodonts, and the ancestors of mammals)
Some people classify turtles and tortoises as Subclass Testudinata, as they believe turtles are much more advanced than the primitive anapsids and should not be lumped with them. Other people consider turtles descendants of a diapsid reptile, but the evidence for such an ancestry (based on the hooked fifth metatarsal bone) is dubious since Michael Lee points out that the hooked fifth metatarsal is likely a convergent character that has arisen several times independently. Turtles are also ureotelic (excreting urea primarily), a feature they share with mammals and presumably the synapsids, whereas the diapsid reptiles are uricotelic (excreting uric acid primarily). Since no known diapsid has reverted back to ureotelism, it is unlikely that turtles had a diapsid ancestor.
Birds are classified as Class Aves by most sane scientists, even though birds evolved from a diapsid reptile (most likely Longisquama) in the early to mid Jurassic or late Triassic. Some scientists insist on including birds within Reptilia, but most scientists disagree. One dinosaur expert points out that birds are also classifiable as blue-green bacteria when this sort of irrational classification is taken to its logical extreme.