The cannon is not dead yet. All missiles have counter measures and the balance between the two keep shifting. Who currently has the upper hand is a big unknown because ECM and other special counter devices are closely kept secrets. The problem is that if a weapon system is countered, more of it will not help much - so if your missiles fail, taking more of them instead of a cannon will not help.
Lasers are interesting, but as mentioned the have "weather" problems. In addition, lasers can be easily defeated by various coatings. Therefore I do not expect to see wide spread use of lasers anytime soon.
Cannons still have room for development. It will always be a short range weapon, but it does not have to be a boresight weapon. They can be gimbaled at least to a certain degree to allow a wider envelope of threat. There are talks of guided munitions to cannons. This is a limited guidance system either in closed (inflight continuous corrections) or open (pre launch maneuver command) control loops. 100 bullets are harder to counter than 1 missile even and sometimes because their guidance is simple. They will rely on sensors carried by the jet which are better than what can be carried by a kill vehicle itself.
Such smart cannons will still be limited in their envelope and will never be an all aspect weapon, but on the other hand they are nearly impossible to counter - except by maneuvering out of their envelope. In such a case, maneuverability is till important both offensively and defensively.