At jobs when I actually had co-workers I generally just wouldn't go out with them. 40+ hours a week with them is enough. A few times I have though. I just made sure to drink at about the same level as them. If they are pounding drinks and getting wasted that works for me but if they're just having a few beers then I do the same.
Straight out of college, I moved to bumfuck New Mexico, 2,000 miles from my nearest acquaintance, to work for a small newspaper. Most of the other eight reporters had made similar leaps. As the town we lived was small and devoid of young people, we were about the only educated 20-somethings in a 1.5-hour radius. We drank together all the time, at least twice a week, and it never caused any issues. I continue to keep in weekly contact with four of them, something I can't say about any of my college friends. At my next job, my bosses routinely bought cases of beer and brought them into the office on Friday afternoons, so I had one or two with literally all of my co-workers. I never met any of them for anything more than that, though. Not because I was against it, but because they were all either vastly older or really, really, really lame. Drinking with people you work with is perfectly fine in my opinion; in fact, I'd wager that's how a very high percentage of young professionals socialize. Once you get a little older and have more responsibility, I can see it maybe being a tad taboo. But aren't a ton of networking events based around alcohol? Just take it easy. Now I work from home and drink with my co-workers all the time. Alone. In the dark. On Tuesdays.
My drinking policy in large groups of people I don't trust: Have one beer in a can or a dark bottle. Refill container with water. Observe as everyone else deteriorates. This includes most groups of people I've worked with, including every classic "office" group. I enjoy the sauce because it opens up previously unexamined areas of my psyche. While it can heighten my comraderie with others doing likewise, I have zero motivation to do this in the company of bosses, co-workers or power-politickers. I generally dislike being drunk in the company of anyone who isn't. But repping Team Sober at the office Christmas party has the added benefit of blackmail material. When I show up one morning after a bender, you'd do well to not crack wise about it, lest I bring up your supply-closet tryst with Mairead from HR. This excludes people I've worked with on anything "creative."
My first few jobs were hospitality based - so it was a given that you drank with coworkers. Usually while working. Often before work also. Hell, in those days I stayed away from hard drugs - but I've seen the boss handing out bumps of cocaine in those gigs. I moved into white collar (or more accurately, black t-shirt) IT jobs - and the first few companies were big party companies. It was routine for the boss to throw down his credit card and open the bar. A case of Johnny Walker Blue to celebrate hitting a sales target or completing a project was common. I dirty danced with a director's wife while doing tequila body shots with the the other director's girlfriend at more than one corporate function. Of 150 employees, less than a dozen were over 30, and those guys and girls still liked to party. We had a couple of tables booked every Friday night at the local bikers bar and it was a given that any time a sci-fi movie came out - the directors were going to rent a cinema and give us an open bar for the night. It was awesome in a weird, geeky way. We all had privacy filters to keep a few details away - but as the company grew and the directors sold out and went to drink on yacht's instead of at company parties - we started to keep the whole thing a bit more off the radar from senior management. But most of the staff still drank heavily and a big chunk of that group would go to clubbing and do drugs at each others houses. I still didn't tell most of those people about my weekends when I wasn't doing drugs at their house... My next job was with a bunch of guys who restricted themselves to two cups of tea a day so that they didn't go crazy on the caffeine. In a 10 person office, I single handedly tripled the daily caffeine consumption level. I didn't drink with those guys. The one company party I went to, I had one beer and couldn't reasonably drink a second without looking like an alcoholic. I didn't tell those people shit about what I was into outside of work. Working on the mines or at an abbatoir, I drank to be one of the boys. There only alternative was being a social pariah with no ability to function in the work place. I've swung back to moderate boozing only these days - there are a few guys I work with who I consider friends, who I'll talk to honestly about my weekend. I've drunk more since I started working this gig than any time in the last 8 years. The stress level here is unbelievable, and without booze and good mates - I would have rage quit and dealt with being poor. As it is, I'm still getting close to that point while I look for another gig.