From the Dutch Golden Age onwards, they’ve become fashionable for a while. Examples from Whistler, Turner, Kuindzhi, van Gogh, and others.
Morgenstern
From the calm of Vernet’s Italian coast, through Heligoland, to Monet at Honfleur, and the Straits of Bosporus.
More superb coastal nocturnes by Aivazovsky, Atkinson Grimshaw, Winslow Homer, Edvard Munch, and others.