Some of the best moments in Rowling's books occur when she reminds us that the wizards-in-training at Hogwarts are, after all, just children.
Even at a school of witchcraft and wizardry, classes can be boring and seem pointless to children.