Some have called it a U-turn; others have described it as a shambles. But John McDonnell’s volte face was the right thing to do, even though it meant losing face, big time.

On the eve of the Labour party conference, McDonnell surprised detractors and supporters alike by saying that Labour should vote for George Osborne’s new fiscal charter, which requires the country to run budget surplus in “normal times”. Now McDonnell says his party should vote against it.

Admittedly, even when proposing to vote in favour of Osborne’s charter, McDonnell advocated a different vision of fiscal responsibility from what the chancellor was proposing. McDonnell pointed out that running a budget surplus means taking demand out of the economy, so there is an economic illiteracy in wanting to run one more or less permanently. He also argued that surplus should be run only on the current (consumption) component of the budget, and that deficit could – and should – be run on the capital (investment) component of it. His view was that if you borrow to invest, the debt will more than pay for itself in the long run as the investment matures and raises the economy’s output, and thus tax revenue.

The shadow chancellor was also insistent that, even while reducing the deficit, he would do it in a more equitable way. Rather than mainly squeezing the most vulnerable groups, as the Conservatives have been doing, the fiscal gap would be closed by raising taxes on the top earners and, especially, being much tougher on tax avoidance and tax evasion.

However, these are all part of the fine print. Once you accept that you have to run a budget surplus in order to be “responsible”, you have, as an anti-austerity politician, already lost the debate. You win a political debate by making people accept your vision, not by pointing out that you offer them better terms in the fine print – which they are unlikely to read anyway.

So if McDonnell is going to win the economic debate, he needs to change its terms. He has to start by doing another U-turn on the statement: “We accept we are going to have to live within our means, and we always will do – full stop.”Because this is simply wrong. This view assumes that our means are given, and we cannot spend beyond them. However, our means in the future are partly determined by what we do today. And if our means are not fixed, then the very idea of living within them loses its meaning.

For example, if you borrow money to do a degree or get a technical qualification, you will be spending beyond your means today. But your new qualification will increase your future earning power. Your future means will be greater than they would have been if you hadn’t taken out the loan. In this case, living beyond your means is the right thing to do.

Now: if you are a government, your means are even more flexible.

Like individuals, of course, a government can increase its means in the long run by borrowing to invest in things that will make the economy more productive, and thus increase the tax revenue. If a government invests in improving the transport system, it will make the country’s logistics industry more efficient. Or if it invests in healthcare and education, that will make the workers more productive.

More importantly, unlike individuals, a government has the ability to spend “money it does not have”, only to find later that it had the money after all. The point is that deficit spending in a stagnant economy will increase demand in the economy, stimulating business and making consumers more optimistic.

If enough businesses and consumers form positive expectations as a result, they will invest and spend more. Increased investment and consumption then generate higher incomes and higher tax revenues. If the tax take increases sufficiently, the government deficit may be eliminated, which means that the government had the money that it spent after all.

If Labour wants to re-establish its credentials for economic management, it needs to start by rejecting the “living within our means” mantra. The idea may have as much obvious appeal as other examples of homespun philosophy, but it is one that is more fitting for 18th-century household management than for the management of a complex 21st-century economy.

Unless the Labour party changes its foundational belief in the virtue of the government living within its means, British voters will never be convinced of the finer points of Keynesian economics, or of the ethics of inequality, that John McDonnell is trying to make.