If there's something that truly requires uninterruptible concentration, you just stay home and work there, or put in your noise-canceling headphones and zone everyone else out at the office.
When you work with people you consider friends, the last thing you want to do is sit in an office. For that reason alone, I'm not convinced offices make people more productive. I'd rather keep people happy and the productivity will follow.
I hope you're statement is based on more than your experience at Microsoft or at least them as of late, it's pretty clear that they've become seriously dysfunctional.
Open spaces "foster teams that talk to each other, constantly, about the product".
Well, that's nice, but when does the actual creation of the product occur? And how truly difficult are the products developed in these sorts of environments? E.g. are you just bolting together existing "parts" and the user visible stuff is overwhelmingly critical? ADDED: or are you doing something like ViaWeb (the extreme level of store customization that was never replicated in C++).
If you have people who absent a panopticon are "sneaking off to some vice website every 5 minutes" then you've got much greater problems than anything related to your environment. They're not dedicated to the project, perhaps because they don't have what it takes, perhaps because you've failed to create the necessary conditions. Either way, I don't see any good alternative to solving the root problem (and if your company is a really bad and dis-motivating place, why are you still there???).
I know that there's a well established rule of thumb that states close collaboration just doesn't tend to happen beyond 30??? feet or a single staircase (i.e. people further apart just don't tend to collaborate). This is of great interest to universities and other places that do research, you should be able to find something, maybe in Peopleware (which if you haven't yet read you want to anyway).
(To emphasize how different, we can be pretty sure that very few if any of the programmers studied had a memory budget even close to what's been in mainstream CPU caches for some years.)
For another example, see MIT's termination of SICP/6.001/Scheme with extreme prejudice and replacing it with Python based "bolt together" course(s) (I don't know anything about 6.02, but the initial 6.01 robot project is just that ... which is not to say that it's easy, e.g. it requires the use of differential equations and its labs are very instructor intensive, to the point the department is recruiting upper-classmen to help).
MIT believes that things have fundamentally changed....
This helps avoid the "talkers vs. typists" problem--don't mix the two. For example, don't put me near the support guy who has loud and frequent speakerphone discussions about resetting passwords, his personal doctor visits, etc. ;)
The 'we have no heirachy - the owner doesn't have an a office' open cubical farm where you are stuck between chatty secretaries and shouting salesmen.
And the private offices where one office = one person = one module and the only way to talk to somebody about 'their' part was a request up the management chain.
Best was a 'programmers only' room with one huge desk for three programmers on the same project.
This is one of the reason why programmers tend to be weirdos and outcasts.
This is also a reason that you often found crazy complex code. As you mentioned it before, they become territorial. I often met with programmers whom you can't just disagree with. It's like they live in their own world and everything they do is right according to them. Coincidentally when you write your own program, you're a god in that universe.
The stories of "a small group of great developers working together on a great product" were often being told in HN threads. Please understand that we should emphasize more on the word "group" and the phrase "working together". They don't work alone.
By the way, I had experienced private office too before. Boring.