This isn't a great analogy, to be honest. Modern naval warheads are time-delayed to detonate with the fuse senses the missile is within a cavity. That leads to the blast occurring within the ship, not against it and having the blast be omnidirectional. Proximity and impact fuses use to be the most common, as where shape-charged warheads, but today programmable fuses and HE-Blast Fragment warheads are more en vogue.
It's also important to keep in mind that while yes, an explosion does lose power due to heat and light generation, the warhead's makeup determines just how much and how vigorous that process is. Take the Norwegian Navy's Naval Strike Missile as an example of both statements above. Its fuse permits it to detonate within a ship, void-sensing we call it, as shown in the video below during a test against Oslo Class Frigate KNM Trondheim, but its warhead is as energetic as that of Harpoon Block II despite being half the size due to its chemical makeup
Brahmos has what's called a semi-armor piercing warhead. This is a fancy way of saying that the warhead of the Brahmos missile was designed to detonate only after the warhead's fuse has sensed that it's breached a hardened surface, though it can be programmed for delayed or position-oriented detonation too. This arrangement is due to the speed at which Brahmos flies leaving the time needed for contact detonation to be too short to accurately measure. But it has the secondary effect of seeing the warhead detonate from within a ship maximizing the blast effect in multiple directions.
Brahmos is in essence a modernized version of the SS-N-22. Large, fast moving with a high blast yield. But like the SS-N-22s in the video below, Brahmos travels too fast for most contact fuses, so unless opting for a proximity fuse and shaped charge warhead to maximize the missile's destructive potential a void-sensing fuse, as demonstrated in the video is the best recourse.
You're not wrong, but that analogy applied more so to impact fuses and blast fragment or high explosive warheads. Shaped charges or void-sensing fuses mean the blast is either directed towards a target, along with missile fragments, or that both the missile's blast yield and thermal energy are directed outwards from the detonation while within the target ship leading to greater damage.