I'm not sure there is a definitive answer, but my heuristic is that if
I'm going to do a few things with the connection, I'll use the first
form (send code into the block, as this ensures the connection shuts
down at the end of the block.
If I'm only getting one thing and then carrying on with it with no
need for using that connection again, I'll use the second form.
But again, this is only a heuristic, and not definitive.