In a saucepan whisk together sugar, cocoa, cornstarch and salt. Whisk in half the milk to make a smooth paste and then stir in the rest. Place saucepan over medium heat and cook, stirring constantly, until a boil is reached. Continue to cook until thick and very smooth. Remove from heat and add butter, vanilla, and optional flavored extract until melted. For very smooth pudding strain through fine wire mesh and place in bowl. Cover with plastic wrap directly on surface to prevent skin from forming and refrigerate until firm.
Serve in shot or wine glasses with taster sized spoons. Top with colorful garnish like a raspberry or a dollop or whipped cream.