https://en.wikipedia.org/wiki/Beyond-visual-range_missile
BVR is kind of a cold war tech; "its WW3 shoot down all the soviet bombers" it doesn't have another mission at this time. To risky to use.
But it is incorrect, because most engagements in Ukraine ever since the first month of the war have been at beyond visual range. And should a conflict ever break out between China and the US, pretty much if not literally every air engagement would happen at beyond visual range. Just because it hasn't happened much doesn't mean it's an outdated idea, it just means that powers with significant air forces haven't shot at each other lately.
The Phantom (?) initially didn't have a cannon. Why? Becaise before Vietnam everybody thought dog fighting to be obsolete. Then the US Navy created Top Gun, becaise it turned out dog fighting very much did happen. Same for BVR, and as soon as the other side is stealthy enough to be only discovered up close, well, all engagements are going to happen at visiual range again anyway.
Not to forget, a F-22 or F-35 carrying serious load outs, tanks l, missiles, bombs, is pretty mich non-stealthy any way.
A gun is almost utterly useless in modern fighter aircraft, especially for air to air engagements, especially in a world where the AIM-9X and its opposing side equivalents exist. You will never, even WVR, even if you graduated TOPGUN, get into a position where you can use a gun against an opponent with an AIM-9X on the rail.
Well, yes, also, most within-visual-range engagements probably also happen that way. Targeting the enemy first is kind of a big deal in air-to-air combat, and he who does it is probably going to be by virtue of doing so the shooting side.
> Not to forget, a F-22 or F-35 carrying serious load outs, tanks l, missiles, bombs, is pretty mich non-stealthy any way.
While both can carry external stores, the reason that they have internal weapons bays with significant capacity is specifically so that they can conduct combat operations while maintaining stealth. The tactical environment will determine how they are configured for any given mission.
BVR is a tricky technology. If your rules of engagement let you indiscriminately kill something without being sure of its identity, it's capable. But you need to not have normal air traffic in the area or not give a shit about the consequences or both.