Being brainy in 19th century Oxford was no fun, if the experiences of that tortured soul William Ewart Gladstone (1809-1898) are anything to judge by.

The future Member of Parliament for Oxford University (known as burgess) and four-times prime minister came up to Christ Church from Eton in October 1828, and went on to obtain a double first in classics and mathematics three years later; but not before some of his less academic but more boisterous contemporaries at that rich college decided he was a prig and a swat.

In the middle of a March night during his second year, a group of them attacked, beating him up and trashing his rooms in the lovely Canterbury quad, which had been designed by James Wyatt and completed about 35 years previously. Some say Evelyn Waugh was thinking of Gladstone when he created the fictional character Paul Pennyfeather a century later in Decline and Fall. He too heard “the sound of the English county families baying for broken glass”.

Be that as it may, the incident gave rise to an entry in his diary, which he kept daily from the age of 15 to 85, that to modern eyes seems cringe-worthy enough to justify his assailants!

He wrote: “Here I have great reason to be thankful to God whose mercies fail not . . . 1) Because this incident must tend toward the mortification of my pride, by God’s grace . . . It is no disgrace to be beaten, for Christ was buffeted and smitten. 2) Because here I have to some small extent an opportunity of exercising the duty of forgiveness.”

Ugh. The entry, and voyeuristic insight it gives into the great man’s private thoughts, is a warning against diary-keeping if you want to keep secrets.

Poor Gladstone famously had much to keep secret, particularly the exact nature of his lifelong and so-called “rescue” work with prostitutes. His first recorded encoun-ter with one of these ladies occurred in Oxford in August 1828, when he was on a preliminary visit to the city, even before he had been matriculated at the University. The first night here he selected a prostitute and had a long conversation with her, and the second night sought her out again.

Since the earliest days of the existence of Oxford University, prostitutes were common (as in port towns) thanks to the all-male make-up of the University. They were also the particular target of Proctors or Bulldogs, the University police who can trace their origins back to 1248, who for much of that time had the power to expel them from the city. (Lucky, therefore, that Gladstone was not yet a member of the University and did not attract their attention.) Early biographers of Gladstone exonerated him of all fault in this respect, but with the publication of the diaries it became clear that he himself knew that there was something “carnal” about his habit of night wandering, even if he never sinned in deed.

Roy Jenkins in his 1995 biography wrote of that early Oxford encounter: “It is impossible to believe that frissons of excitement did not guide his steps on at least the second evening.”

This was the man who was largely responsible for preparing the Parliamentary Bill, introduced in 1854, that was to change Oxford forever by, for instance, reforming college statutes and abolishing sinecures; and by introducing honours examinations for most schools of study.

He was a great man who loved Oxford and was driven by a sense of duty, and in the end why should he be brought low by his own diaries?

After all, by chastising himself (literally, with a scourge) he was doing no differently to other devout Victorian Oxfordians, including Newman and Pusey.

As a footnote to all this, long after the grand old man’s death, his sons managed to have their father’s name cleared in court, even though as a general rule the law cannot be used to protect the reputation of the dead.

They responded to the author of a scurrilous book with such vehemence that the author sued them and lost; with the jury going out of their way to say that the evidence: “completely vindicated the high moral character of the late Mr Gladstone”.