The British M-class submarines were initially designed for shore bombardment, but their purpose was changed to attacking enemy merchant vessels as their 12 inches gun would be more effective at long range than a torpedo against a moving target.