OP here. I think it depends on your habits and situation. For me, avoiding the cafe for 4 hours is a lot easier than ignoring my computer and phone for 4 hours.
To use the internet at the cafe, I have to put on my shoes, my coat, walk 5 minutes, buy a coffee, sit down, open my computer, etc.
It's not hard to do any of that. But it's a lot more effort than pulling my phone out of my pocket.
And, having gone through doing all that, presumably once you get there, you feel a stronger to at least accomplish something, to vindicate your efforts. :-).
It's one of the main reasons I find value in having an office, and it is a non-trivial (though, thankfully, subway-based) commute away.
To use the internet at the cafe, I have to put on my shoes, my coat, walk 5 minutes, buy a coffee, sit down, open my computer, etc.
It's not hard to do any of that. But it's a lot more effort than pulling my phone out of my pocket.