'We're not gonners", cried the Govan union convenor, Jamie Webster, yesterday, relieved that "only" 800 shipyard jobs are to go in Scotland.

The unions have shown a defiant realism in the face of adversity thathas not always been evident in Scottish industry recently.

The Clyde has been written off so often that you forget it is one of the most technically advanced and efficient yards in the world. It is a tribute to the workers that the decision to save Scotstoun and Govan was taken on hard commercial grounds (as they offered the best value around) and not for political expediency.

But this is a huge gamble by the British Government that the United Kingdom has a future after the referendum. Scotstoun/Govan is to be the centre for nearly all UK naval shipbuilding for the foreseeable future and, most importantly, for the new Type 26 Global Combat Ships due to hit the water by 2020. As a sweetener, the UK Government has even ordered three offshore patrol vessels to keep the Scottish yards going until the Type 26 orders come on stream. Did the referendum save Scottish shipbuilding? Unions at Portsmouth, where shipbuilding is to cease after 500 years with the loss of 1000 jobs, think so. The local Conservative MP, Caroline Dinenage, said English jobs were sacrificed for Scottish ones and her Liberal Democrat colleague Mike Hancock called it bribery. Ministers saved Govan to save the Union, he said.

There seems little substance to this claim. BAE Systems had made clear at least two years ago that they wanted to consolidate warship production on the Clyde, where the technical skills and capacity are located. Some 250 workers are already employed on the Type 26 project in Glasgow. There was never any real possibility that Portsmouth would win on business case alone. It could only have prevailed if ministers had listened to those MPs who argued that the next generation of frigates should not be built on the Clyde because of the risk of independence.

The Defence Secretary, Philip Hammond, was coy yesterday on whether the orders for the frigates would continue if Scotland votes Yes. The Scottish Government is supremely confident they will be, as it would make no commercial sense not to, this decision having been made. BAE has been running down Portsmouth in anticipation of this result. It would be irrational to close the Clyde in spite, and at enormous cost, just because Scotland voted the wrong way.

There had been fears that, under European competition rules, the rest of the UK might not be allowed to order the frigates from an independent Scotland without putting them out to tender. Since there would be at least an 18-month period before Scotland became legally independent in 2016, there seems every likelihood the contracts will be signed and sealed before this was an issue.

Mind you, the Scottish Government is furious at the Labour MP for Govan, Ian Davidson, who had called for a "break clause" in any warship contracts for Govan/Scotstoun to permit cancellation in the event of Scotland leaving the UK. This would not only have held Scottish shipbuilding, and his own constituents, hostage to the referendum campaign, it would have created a climate of uncertainty on the Clyde that would severely have damaged its prospects, and might still do.

So far this looks like another successful outcome for Alex Salmond, following his handling of Grangemouth. He isn't quite out of the woods yet, however. Regardless of the immediate future of Scotstoun/Govan, the British Navy does not as a rule order complex warships from foreign countries. There is clearly a risk (if Scottish representation is withdrawn from Westminster) that some future orders might go astray.

It is not perhaps as big a risk as it might appear, since an independent Scotland, in the kind of reconfigured UK the SNP envisage (keeping Queen, pound, Nato and so on) would not be in the same category as countries such as South Korea, Japan or China, where 90% of the world's ships are built. There is bound to be a large degree of defence co-operation after independence between Scotland and England. Indeed, according to Jane's Defence Weekly, the UK Government explored collaboration on the Type 26 with a number of foreign countries, including Canada and Australia.

Nicola Sturgeon said yesterday that an independent Scottish Government would order five of the Type 26 frigates. She insisted Scottish shipbuilding could continue to thrive after independence, just as it does in Norway. Perhaps. But the Nationalists should be careful. An independent Scotland will never be in the business of ordering £6 billion aircraft carriers of the type being built on the Clyde. Norway builds supply vessels for the North Sea, which is a bit like comparing a microlight to a jumbo jet.

Size isn't everything, of course. Of the two aircraft carriers, one will be mothballed immediately upon completion and may never see service, while the other one is expected to operate without the aircraft it is designed to carry. These projects are already 100% over budget and will no doubt be late because there is no great incentive to finish them. Mr Hammond confirmed yesterday that they're only being built because the original contracts were so badly drawn up it was more expensive to scrap them than to proceed.

These carriers have saved jobs but at ruinous cost to the taxpayer. The obvious comparison is with Trident, an expensive weapons system designed specifically to destroy Soviet cities, which has no known targets and represents the economic equivalent of paying people to dig holes and then fill them in again. Scotland under independence would indeed be the moment to reassess the future of Scottish military ship-building and to diversify out of high-value military orders. The three patrol vessels being built might provide a template.

No-one in the SNP can guarantee that, after independence, Scotland will be building many advanced warships and diversification could mean the end of shipbuilding altogether. The SNP risk damage to their cause by always suggesting that nothing will change with independence. There will be costs as well as benefits to self-government and Scottish voters are surely grown up enough to realise this. Independence is about aspiration and possibility, not maintaining the status quo.

These are arguments for another time. This week, while lamenting the loss of the 800 jobs, Scotland has every right to modestly celebrate the success of the fight to save Clyde shipbuilding, orchestrated by the Scottish Government. We have had two close industrial shaves, Grangemouth and Govan/Scotstoun, becoming a bargaining chip in the referendum campaign. The UK Government should be commended for not playing politics with the Clyde. The SNP and Scottish Labour should also take a moment to reflect. Their responsibility is to ensure Scotland isn't damaged by party politics and brinksmanship. We really are all in this together.