A few years ago a flurry of excellent historical publications reminded us that the “computer” wasn’t always a box of electronics.

David Alan Grier’s When Computers Were Human (2013) described how the drudgery of repetitive calculation, essential to endeavours such as astronomy or the production of mathematical tables since the 19th century, had been the work, as the title suggested, of human “computers”.

More pertinently, Jennifer Light has argued that these computers were women. The job of operating the Eniac, a giant electronic calculator built to churn out ballistic tables in the Second World War, was undertaken by a female workforce. Nearly 200 women contributed to this aim of speeding up calculation, and six were directly involved with the novel task of “programming” the Eniac. They had been written out of history. In fact, the “job of programmer”, says Light, “originated as feminised clerical labour”.

The film, Hidden Figures, is based on the true story of three women working at Nasa in the 1960s, and the subject of a book by Margot Lee Shetterly. This immensely engaging feature film extends the point further: the crucial “computers” here are human and female, and black.

Taraji P Henson plays Katherine Johnson in the film (Fox)

Katherine Johnson, Dorothy Vaughan and Mary Jackson are three members of the West Computer Room of Nasa’s Langley Research Centre. The Soviets have launched Sputnik, and the Americans are scrambling to catch up. The trajectories of the Mercury capsules, as they carry the first American astronauts from launch to ocean recovery, must be calculated. Everyone must work hard and contribute. But Virginia is a segregated state. The West Computer Room is for “coloured” computers only, while the East Computer Room is for whites.

At each turn, talent confronts segregation and institutionalised prejudice. The youngest of the three, Jackson, has an engineering aptitude, but has to challenge the segregated school system of Virginia in order to gain the qualifications she needs to gain the status of rocket engineer.

Vaughan is doing the job of supervisor of the team of black women “computers” but is repeatedly denied fair recognition. When she takes her children to the library, the books she needs – such as one on the programming language Fortran – are in the whites-only section.

Johnson is the genius, the former child prodigy, the woman who can calculate trajectories that no one else can compute. Her talent admits her to the Space Task Group, the elite backroom boys tasked with the Mercury calculations, but even then the indignities of racial prejudice follow. There is no “coloured bathroom”, and Johnson has to run, humiliatingly, back and forth across the Nasa campus.

The three protagonists win all their battles (with one notable, bittersweet and significant exception). Jackson persuades a judge to overturn the racist strictures on Virginia schooling. Vaughan marches her black women computers to equal status. Johnson rescues John Glenn’s mission to be the first American to orbit the planet – although is then faced with technological redundancy.

Octavia Spencer plays Dorothy Vaughan (Fox)

Hidden Figures is, certainly, inspirational. Nasa is portrayed very positively too, with the initially hostile white staff learning to respect their co-workers. The “coloured bathroom” sign is smashed to the ground. One is almost left thinking that after 1961-2, when the key events of Hidden Figures take place, the racial politics of space and technology had been settled.

This, of course, is far from the case. In 1970, in response to the Apollo landings, Gil Scott-Heron spoke of the contrast between two worlds in his song 'Whitey on the Moon': 'A rat done bit my sister Nell/With Whitey on the moon/Her face and arms began to swell/And Whitey’s on the moon./You know, the man just upped my rent last night/Cause Whitey’s on the moon/No hot water, no toilets, no lights/But Whitey’s on the moon'.

The relations of 1960s black politics, culture and space were much more complicated, and interesting, than Hidden Figures has time to show in its equation of breaking the chains of gravity and of prejudice. On one hand, there were the bitter, negative complaints – such as Scott-Heron’s – of the continuing racism expressed in prioritising spaceflight over ending inner-city deprivation. On the other, there was the positive embrace of space, science fiction and technology found in the Afrofuturism of the musician Sun Ra (and recently exemplified by the 2010 album The ArchAndroid by Janelle Monae, who, as it happens, plays Jackson).

In between, and perhaps here is where Hidden Figures has extra contemporary resonance, automation through computers was changing the world of clerical work. And there is an interesting alliance struck between an initially excluded technology and excluded black women. Vaughan is the person who sees the incoming mainframe computer as a tool to advance her black computer colleagues. Likewise, a doorway has to be smashed to admit the IBM 7090 computer. There is a mutual interest in breaking down barriers.

The irony is that this computer’s sheer speed (as fast as they got in 1962) meant that Johnson’s unique mathematical talent was made redundant. She might be able to beat the best of the rest of the humans, but not a machine.

And so as we move into a new era, when automation of work is again in the headlines, we might all hope to be more like Katherine Johnson: perhaps replaced by machines but ultimately, dignified.