People who say that a team of programmers team needs to work at the same location to be effective often say something like this:
While tools like (video) chat, screen sharing, and the like have done much to make remote work easier, there is still nothing as effective as being able to turn around, see the person you want to talk to, and just be able to speak. (link)
But is it a good idea to allow people to just turn around and talk to other people? Sure, it’s easy and convenient for the person who has a question. But, in my opinion, it’s also selfish, inconsiderate and it hurts the team productivity.
Programmers need time to focus to be effective. The part of the brain that gets activated when you engage in analytical thinking, including programming is called task-positive network. This neural network suppresses the network responsible for social interaction, called the social network.
This means that the other person that’s deeply focused on the task at hand is not in the best position to take your question. Switching the context is costly, especially since the number of interruption is very high, perhaps happening as often as every 3 minutes and 5 seconds.
What should you do instead? Leave a note using a communication tool that does not interrupt the other person. Taking time to write down the question is also going to force you to structure it in a way that make sense and give you the opportunity to provide additional information that is going to further help the other person help you.
When the other person takes a break (I personally use the Pomodoro technique, taking breaks every 20-25 minutes), he/she will see your message and be able to context-shift easily (and probably end up giving you a better answer).
So, being co-located may feel productive (especially when you’re the one asking questions), but working remotely can be just as (or in my experience significantly more) effective.
P.S. If there’s an urgent issue, interrupting another person is probably worth it, but this should not happen very often (if it does, you have bigger issues to solve).