My son John goes to bed properly dressed, with one stocking on and one stocking off. It's a gently teasing rhyme about a boy too sleepy, or too stubborn, to finish getting undressed.
From Mother Goose / Nursery Rhymes (traditional). See the whole collection.
Diddle diddle dumpling, my son John
Went to bed with his breeches on,
One stocking off, and one stocking on;
Diddle diddle dumpling, my son John.
About this rhyme
Roud 19709 · First printed c. 1797
The rhyme was first printed in London around 1797. Those opening words, 'diddle diddle dumpling', are thought to come from the street cry of men selling hot dumplings, later stuck onto this small joke about a boy called John. The joke is simply that he has gone to bed half-dressed, breeches still on, one sock off and one sock left on, too tired or too daft to finish the job.
That makes it a bedtime rhyme, or a getting-changed one. Point to your own legs and feet as you say it, one stocking off, one stocking on, and a child who won't undress will usually spot themselves in it. A little foot-tickle on the last line lands well.
Public domain. Text from The Real Mother Goose (Blanche Fisher Wright, 1916), via Project Gutenberg. View the source edition
