World leaders' reactions to the Brexit shock included one from an unexpected source: Russian President Vladimir Putin, who castigated Britain's leaders for "arrogance and a superficial approach… to issues that are vital to their country and to Europe as a whole".
Coming from Mr Putin, this criticism of direct democracy might be dismissed as an authoritarian conceit. But there are states with impeccable democratic credentials that share his wariness, not least Germany, which has a constitutional prohibition on referendums, lest another demagogue should use them, as Hitler did, to extinguish democracy and the rule of law.
Brexit leader Boris Johnson, in his victory speech, offered a different view: the United Kingdom's membership in the European Union (EU) could be decided only by "putting it to the people". So when are referendums appropriate in large modern democracies? The answer is that it depends on the question placed before voters.
We would do well to recall the two other referendums held in the UK in the last five years: over Scottish independence in 2014 and, much less memorably, over voting rules in 2011.
Voters in referendums often care little about the question being asked and, instead, treat their vote as an opportunity to register protest against the powers that be or discontent with some unrelated issue. The process is emotionally more satisfying than in a normal election, in which voters cannot see any one issue in isolation, and must weigh their dislike of the incumbent government against the risk of an even less palatable alternative.
This heuristic effect is compounded when a referendum question is perceived to be of little import. A classic example is the French referendum of 1969, when voters ignored the obscure constitutional changes put before them and focused instead on President Charles de Gaulle's prior announcement that he would resign if he lost the referendum. Mr de Gaulle did lose the referendum, and he resigned, as promised.
The victory for the Leave camp in the Brexit referendum seems like a similar protest. While the EU question was weightier than the French one about constitutional procedural matters, it still wasn't enough to discourage voters from pursuing other motives - above all, the desire to give the (pro-European) "establishment" a good symbolic whipping, seemingly at little to no cost. Sooner or later, voters will realise that the price of Brexit far outweighs any satisfaction derived from symbolic gestures. Many will reckon that such momentous changes should never be left solely to the whim of the electorate.
The Scottish independence referendum - which dealt with similar matters of identity and statehood - offers a different, and a more practical, lesson. The stakes could not have been higher, yet it was safe to "put it to the people", because no voter could fail to understand the question: "Should Scotland be an independent country?" Voting intentions hinged overwhelmingly on what voters thought about Scottish independence, as opposed to what they happened to be feeling about other issues at the time.
The lesson is clear: Put questions to a popular vote only when there can be no misunderstanding about how much (or how little) is at stake. Doing so would minimise the risk of voters being swayed by tangential considerations (and, in the case of a low-stakes question, as in the 2011 referendum on electoral systems, the government should not be perceived to have a strong preference).
The Brexit referendum failed that test. Little wonder that we now see headlines like this one from The Washington Post: "The British are frantically Googling what the EU is, hours after leaving it". And the referendum had a more fundamental and fatal flaw: the choice between Remain and Leave was a false one. While the meaning of the Remain option was clear, Leave was no more than a direction of movement, with many possible destinations.
So flawed a question should never have been put to the voters. But, because it is politically impossible to undo the result, the British Parliament should now invite voters to finish the job by conducting a sound referendum process - correcting the flaws in the Brexit referendum - to discover exactly what kind of Brexit the country prefers.
The next referendum would ask voters to approve or reject the non-EU option involving the least change - that is, joining Norway and Iceland in the European Economic Area (EEA). Such a referendum would be supported by pro-Europe voters and moderate Leavers, and opposed by more hardline Brexiters. By ending the current uncertainty, a "yes" victory would limit the economic damage and help to reunify the country.
A "no" victory would indicate that voters are willing to pay the higher economic price to control immigration from the EU (which EEA members are not allowed to do). In that case, voters would be invited to accept or reject the next degree of removal from the EU - that is, a proposal to mandate the government to negotiate a free-trade agreement with the EU, similar to the one Canada has. If that were also rejected, the government would have no choice but to refashion the UK's global trade from scratch within the World Trade Organisation framework.
This process would focus voters' attention on the merits of precise questions at each stage. The stakes and trade-offs would be clear. Voting intentions might be influenced by what people thought of the leading politicians arguing on either side of the question, but the process would no longer be misleading or sensationalised. The exercise would offer a methodical and transparent path to a future for Britain that is soundly based, even if it is deeply sub-optimal by the standards of those who wanted to stay put.
• The writer, a former British diplomat in Moscow, is managing director of Trusted Sources, an independent provider of research and consulting on emerging markets.