Optimal number of classes?
26.
...What?...if you can't find something you want to play within 26 class options, then you probably shouldn't be playing D&D.
In a class based system like D&D is it better to have a few very broad classes or to have a greater number of specific ones? I know I have personally been looking at it from a handful of broad classes based on something akin to the 4th edition concept of Power Source, but I want to hear some other opinions.
If you do favor more classes, at what point do you say "That's the right number of classes"?
Why must it be one or the other? Both isn't an option? Isn't that pretty much what (most editions of) D&D has always been/had.
You have your "Broad classes": Fighter, Cleric, Magic-user, Thief.
Then you have a few "specific" types within each of those for those who want something a bit more "flavor specific."
Fighter: Barbarians, Rangers, Paladins
Magic-User: Specialists, (Sorcerers and Warlocks, <rollseyes> if you insist)
Thieves (or "Rogues"): Assassins, Bards
Clerics: Druids, "Specialty/Domain" priests...
D&D, pretty much from AD&D on (and/or the Companion set of BECMI) has had its "Broad classes" and it's specific options.
Now, granted, when you got into the various 2e splat books and the 3e "prestige classes" things got...ooooo just a bit out of hand, imho.
My homebrew world is essentially the following (though this has been tweaked and re-tweaked over the years):
Fighters (if you want something broad you can flavor however you like)
- Barbarians
- Paladins
- Rangers
Clerics
Mages
Rogues
Homebrewed Monks
Homebrewed Psionicist Order
Homebrewed elvin paladinic sect
A few homebrewed specialty priest classes (
The Daughters of Gilea, the Witch-Priests of Manat, etc...)
A few homebrewed specific magic-users (4 cardinal element specialists, the R'Hathi battlemage, etc.)
So...yeah, let's go with 26.
As delericho said, there is no single answer here. I would simply reiterate that there's no reason it has to be one (few broad) or the other (many specific).

Have fun and happy classing.
--Steel Dragons