Just read Jacks post and agree with pretty much everything he said.
Would add that these are basically anti sub weapons simply because modern ships are not heavily armoured like the ships of WWII. Many modern Anti Ship missiles reduce the HE in their warheads and replace it with incendiary material. The old saying of “it is better to let water in the bottom of a ship (with a torpedo) than to let air in the top (with an anti ship missile)”. However the reality is that anti ship missiles let in fire, which can be just as devastating as letting in water.