I know folks who have trouble giving up cigarettes in part because it's what they do on breaks and there is a social element to it. I used to spend time someplace where the entire staff seemed to smoke and smoking was about the only break activity available. If you tried to quit and went out front to chat with someone else on break, you could guarantee they were smoking. That made it hard for anyone to successfully quit.
So I can see that being a factor with coffee in the work place.
On the other hand if I find something really interesting and/or exciting it can keep me awake till morning and I can't wait to get it solved not needing any stimulant food or even going to the bathroom.