It takes courage and determination to be a Labour party leader. Enemies, before and behind you, disparage your appearance, sneer at your policies, patronise you: you have no talent, are too ordinary – but also too odd. This was Clement Attlee, Labour party leader for 20 years, prime minister or deputy prime minster for half that time, whose leadership gave the country a welfare state and its first proper taste of social and economic equality.

Citizen Clem learned about poverty and inequality via the Haileybury club in the East End of London. He acquainted himself with the early varieties of socialism, and also worked a stint for the economists and social reformers Beatrice and Sidney Webb, on the 1909 Royal Commission on the Poor Laws minority report. Beatrice Webb, an early disparager, told him that to be a first-rate organiser he had to have more “push” and later commented that, though gifted with intellect and goodwill, “he had, alas, no personality”.

London’s Eastenders thought differently. Attlee was co-opted as mayor of Stepney at the end of the first world war. He was first elected as MP for Limehouse in the 1922 election (when nationally Labour won only 29.7% of votes cast). Insults from his own side rapidly followed, Emmanuel Shinwell suggesting that he was “just an ordinary person … not going very far”, and Ramsay MacDonald, leading the first Labour (minority) government, announcing that “he was a competent colleague … not the talent to be at the top table”. Despite that, MacDonald appointed him under-secretary for war.

Having been wounded at Gallipoli and then in Mesopotamia (now Iraq) Attlee had ended the first world war as a major, so he was more qualified than many for his new job. And as it turned out, he was just as suited to be at the top table as any of them. But that was not considered even imaginable at the time. No one without the declared push, proper personality, or talent to lead could, apparently, make it.

The squabbles of Labour in the 1930s make the party’s current nastiness seem mild, and there was no letup on Attlee. The Conservatives mocked his suburban lifestyle, with an American journalist describing him as “the epitome of the English suburban man”, with a wife and four children, golf clubs, pipes and garden tools, small and bald. George Orwell called him a “dead fish”, and Labour journals were no help, the Tribune openly deriding him and Kingsley Martin, editor of the New Statesman, comparing him to an ineffective schoolmaster. Only later would “like a geography teacher” become a more common insult.

Attlee’s speaking voice constantly came in for derision. Aneurin Bevan wrote that “he was determined to make a trumpet sound like a tin whistle”. After the 1934 party conference in Southport, and just before his election as Labour leader, he wrote: “I wish people would not always be strangling their friends instead of their enemies.”

In the 1930s Britain was as economically unequal as it is now, Labour was in disarray, and the stakes were high

Churchill should have regretted underestimating Attlee as “a modest man with much to be modest about”. Attlee joined the second world war national government as Churchill’s deputy in the war cabinet, and Churchill came to depend on Attlee’s sensible advice and actions. Attlee’s only criticism of Churchill, one biographer noted, ran “the trouble with Winston is that he nails his trousers to the mast, and then can’t climb down”.

In May 1944, with Churchill and the Conservatives not being able to imagine a forthcoming election defeat, Attlee forecast a swing to the left in the electorate. Despite attempts in 1945 to portray Labour as a party that “sends round socialists to take all your savings”, it won a huge majority of seats in parliament in July 1945. What followed was a national insurance system, new welfare and healthcare, trade union rights, freedom for the colonies from imperial rule, and the implementation of an education act that gave free education up to age 15 to all children.

We have been here before. Both the fractious Labour party of the 1930s and that post-2015 have appeared determined to self-destruct. Both periods were the aftermath of great financial crashes, in 1929 and 2008. Both periods saw the leader of Labour derided. Attlee was 62 when he became prime minster. Corbyn will be 68 two weeks before the 2017 general election. Few people will make any comparisons between them, between how they were treated and how they reacted similarly to all-too-familiar insults.

Jeremy Corbyn on the campaign trail in Oxford. ‘It takes courage to carry on in the way that Attlee did and Corbyn continues to do.’ Photograph: Carl Court/Getty Images

It takes courage to carry on in the way that Attlee did and Corbyn continues to do. At the time, when from all directions they are derided, it is easy to imagine that what they stand for is being lost. But the weight of insults is always heaviest when a Labour leader campaigns for real change, as Attlee did and as Corbyn is doing. Attlee was lucky. He survived at the top of his party long enough to enjoy the victory he fought for. He became Labour leader at the age of 52, 14 years younger than Corbyn was in 2015. Corbyn may not lead Labour into government or coalition, but he has moved the Labour party back to the path that Attlee first trod and away from warmongering. By those criteria Corbyn has had more success than any Labour leader for almost half a century.

It was when Britain was last as economically unequal as it is now, in the 1930s, that Labour was in such disarray, and the stakes were so high. Economic inequalities rose under every post-1970s government in the UK, including under all the Labour governments. Perhaps we should not be surprised that in such turbulent times the Labour party is again at war within itself. The brief ceasefire in the Conservative civil war is also unlikely to hold for long. That civil war resulted in Brexit and is far from settled despite the referendum.

The countries of the UK are in economic peril as the pound weakens, food prices start to climb, and the housing crisis approaches a crescendo. Absolute poverty rates are rising and life expectancy is now falling. You have to look back as far as the 1930s to find so much going wrong so quickly. Today is different, but the echo is uncanny, and the ideas of the one leader calling for social progress at a time of economic disaster are again widely ridiculed, ignored or dismissed.