Around 1900. They were held in very dubious regard in the early days of development.
https://www.usni.org/magazines/proceedings/1941/january/chap...
On British naval luminary compared submarine warfare to piracy, leading to the emergence a few years later of a tradition of Royal Navy submarine captains flying the Jolly Roger after completing successful missions.