Could a large-gun submarine bombard coastal fortifications from over the horizon and then submerge to escape?
Short answerOnly under unusually permissive conditions, and even then it would be inefficient; spotting, sea motion, exposure, and hull vulnerability make a surface ship the better gun platform.
NotesAn artillery submarine sounds attractive because it could approach with a low profile, bombard a coast, and dive when threatened. In practice it still needs reliable spotting, exposes itself for an extended firing period, and carries a gun that is inefficient for most submarine missions. Late-war American boats in the Sea of Japan might have bombarded ports after controlling the area, but that would have used spare capacity rather than justified the design. The pressure hull remains vulnerable even to relatively small shells, while a surfaced submarine rolls and pitches too much for dependable fire in ordinary seas. A destroyer therefore retains the advantages in fire control, stability, volume of fire, and damage tolerance.