I've shared an office with a teammate before, and it was very productive. It was a great mix of heads-down work and the ability to discuss issues/design as needed.
OTOH, someone I know started a coworking space a few miles away from my home. I popped in there a couple of times to check it out and decided it was very much not for me. Too much "collaboration" and background noise for me personally, though some thrive on that. The clincher for me was one time there was supposed to be a presentation that sounded interesting, and well after it was supposed to start someone announced that it had been canceled last minute. "Well, I'll do a little work then," I thought. Then they announced that since the presentation wasn't happening they'd be playing talks from YouTube. Great, no work after all, big screen video and blaring audio of something I can watch myself at any time, because why? I dunno. Just not for me.