If the door is open, come on in. If the door is shut, and something is on fire, knock. If the door is shut, and something is not on fire, seek alternative means (email, ask someone else, etc).
Honestly, if people can work remotely, why can't they work from the office in a room with an actual door? I am not sold on open floor plans, but if that is what you end up with, I would at least prefer a quiet one.
Note: this is based on what I was told when I interviewed for an ops role there in 2011. No idea how universal/up-to-date it is.
If people really can do productive coding work with 4 people within 10 feet of them all having separate phone conversations, great, let them stay in the open bullpen-style areas. For others who need some modicum of quiet and non-visual stimulation, give an office with a door that closes things out.
But if you did that, there'd be very little visual status between a CFO and a developer.
Those who insist on developers being in open bullpen areas would do well to try to do their own work out in the same area for a month. They'd see just how hard it is, and how much unproductive stuff actually goes on in many situations.
Alas, the managers in one College I worked in were doing manager schedule stuff, so when they did the 'work out on the front desk' thing one day a week, they did fine...
I'm not even meaning just developers here - I've known accountants/financial people who complained about ability to concentrate when sharing a cubicle with others.
Offices simply need to have a decent number of private office spaces that people can move in to when they need 'alone' time, open collaboration areas, and larger closed off meeting areas for small group meetings. People beyond software devs would benefit from this too, but it doesn't seem to be a high priority for office planners and managers. :/
If you need to collaborate, take your conversation to a meeting room to hash it out. The general working area should be as quiet as possible.