Why I Use to do all my Writing in Coffeehouses.
My first novel, "Love, Sex, and Understanding the Universe" was entirely written in coffeehouses. I worked on that book for so many years that the coffee houses include those in San Francisco, St. Thomas USVI, Eureka Springs and Fayetteville, Arkansas. Coffeehouses provided, along with - obviously - lots of free flowing energy educing warm beverage, an escape from dishes and laundry screaming to be washed, phones (pre-cell phone) demanding to be answered, bills needing to be addressed, family members intruding etc.
Libraries offer this same escape - minus the java juice - but libraries tend to be too quiet - except for those pesky books shouting "look at me, look at me!" - so quite, in fact, as to induce sleepiness. More importantly though, libraries do not offer the other great feature of coffee shops - inspiration in the form of life and activity. Now one might think these things would be distracting, what I found though is that when the writing flow is going, activity around me becomes vague background noise, but when the flow isn't easily forthcoming, the activity provides sparks of ideas, triggers memories or emotional reactions, and then here comes the flow - the words start to form, push their way onto paper and off I go.