Not to show my age, but my first ship was fitted with hammocks an this is where I slept for the next 9 months.
Most yachts do not have a room down below to swing a hammock.
The hammock used was not like you use at home in your back yard, ours were made of heavy
canvas an we placed a small hard mattress inside,
sheets were fitted An the top sheet an blanket were tied at one end, the other end had a stick spreader which kept the nettles (the string or
rope holding the hammock)apart.
The hammock was slung bar taut (as tight as possible) an we then swung ourselves into it.
I was in a small ship An she rolled, but once it my hammock I had the best night sleep ever.
A well lashed hammock could be used to
plug a hole in the
hull, an used to keep you afloat (lash up An stow).
Don’t try an sling a hammock after a few beers ashore it does not
work.
In answer to your question great at sea if slung properly.
Cheers