MoS has great post on the F-35A's gun problems. 2019 and they think it might finally be OK to shoot the thing! The other F-35s are gunless and require and externally mounted gunpod, and in all cases carry ammunition quantities far below any current fighter standard - some more on that in a sec. But first, some points to consider.
First, people have been bolting guns to planes for 100 years now, so at least this bit should be a no-brainer. However, with this strange little aeroplane, they've had amnesia and made the sight/trigger on the F-35 a block of complex computer code instead of a mechanical or electro-mechanical system, and failed miserably.
Second, fighter gun systems are less about the amount of ammunition carried and more about delivering the most mass or destructive power to a target in as short a time as possible. Guns are used in close air to air combate or strafing runs: it's important to know that fighters move very fast and there isn't time for some long burst of fire. Whether it's a tank on the ground or an enemy fighter, the speeds involved means that any target might only appear in the sight for a second or two or even less, making the amount fire the gun can deliver in that time very important. It may mean that the smaller number of rounds carried by the F-35 is thought to be adequate (should the gun work) because the technological innovations, larger calibre of ammunition (30mm vs. current ~20mm standard) in the F-35 mean the plane will be more 'efficient' in its gun deployment.
Third, early in Vietnam, the US air combat thinkers had decided that the future was all missiles and didn't build guns into new fighters like the first F-4s. This cost them as North Vietnam had Soviet planes with lots of guns and focussed on getting close enough to use them on US aircraft. Being close enough to use guns generally means being inside the minimum range for using missiles. No gun in that scenario = very big problem and later versions of US planes like the F-4 all had built-in guns.
So what does this mean for Canada?
Right now, the most important role for the RCAF isn't optional bombing campaigns in one far flung part of the world or another. It is NORAD and NATO air defence, which as it did in the Cold War means intercepting Russian fighters and bombers near NATO and North American air space. You can see from the photos they publish just how close at least some of the aircraft can get to each other, which is well within gun range (I wonder what Voodoo crews thought when that happened), and definitely inside missile range. If something were to go wrong there during a fighter-fighter intercept, a dogfight would ensue and guns and agility would play major roles in the outcome. A less agile and gun-troubled aircraft like the F-35 would be at a prima facie disadvantage! Know this:
The primary Defence of Canada role for the RCAF is as an air defence (i.e. fighter) force because the main military threats to Canada still come from the air. This should be the only fact that really matters in any new Canadian fighter purchase.
This minimal concern for the gun points toward what the F-35 actually is, which is a deep penetration bomb truck. During the Cold War, Canada's CF-104 Starfighters were deployed to Europe as high speed deep [nuclear] strike platforms, not as air to air fighters. Even if it worked, the F-35 is essentially a CF-104 replacement, not a CF-18 replacement.
By not pushing for something designed as a fighter from the start, the Harper Government might be said to be abdicating its first military responsibility: defend Canada.