I code in bars all the time... Granted, this is usually on Sunday at 2:00 in the afternoon, on the patio, and with my dog laying at my feet. It's wonderful, very relaxing, very easy to concentrate.
If it's at night (I've done this too), the loud people act like a white noise generator and leave me alone in my thoughts.
If it's at night (I've done this too), the loud people act like a white noise generator and leave me alone in my thoughts.