When I did customer service for an application I was developing, I found that most of the time, if I did NOT answer the phone, the user would figure out their problem and learn more than if I did answer. Some people would just call up any time the slightest thing happened, if I kept answering.
With students, when I am in class and they are working on coding assignments, the same thing can happen: they will ask any old question that pops in to their head because I am sitting 5 feet away (usually trying to grade assignments or prepare to lecture). Sometimes the questions are quite elementary. Other times, it amounts to structuring a complex If-Else or something that they could do, but they have difficulty with. The only 'help' I can give is to explain how it should function. They learn that way, but then I become the Oracle.
I do often deflect questions or look at the problem they are having to know that it is something I have taught and then say I need them to work at it a bit more, but this seems to happen a lot. If I was not there, they would be forced to work it through themselves. Is there a way to encourage the students to be more independent, because I have not found it yet.