The popular nursery rhyme, of which the Opies wrote ‘Probably the best-known nonsense verse in the language, a considerable amount of nonsense has been written about it’. The earliest known text dates from c.1765, and it has been regularly printed with little textual variation ever since. Some of the components of the rhyme, however, appeared much earlier, such as ‘a new dance called hey-diddle’ mentioned in 1569 and a poem by Alexander Montgomerie (‘The Cherry and the Slae’, 1597) which includes a cow, a fiddle, and the moon, but which cannot be shown to be the nursery rhyme's precursor. The Opies also list most of the origin theories which have been mooted, none of which has anything to offer beyond speculation. At present we must be content with the fact that the verse is a very effective nonsense rhyme.
Opie and Opie, 1997: 240–1.