Question related to the topic of multiple discussion threads about sexist behaviour in the tech industry...
There are many cases where it is clear ethically and legally what can be said/done with coworkers of any sex - this is one of the cases where the person's behaviour was clearly wrong: https://news.ycombinator.com/item?id=9178681
However, there also some other situation in the modern workplaces where you can find yourself in the legal/ethical grey zone. For example: you gradually become friends with your coworkers, start spending time together doing things outside of your work context. You can end up hanging out privately with your superiors or subordinates and this can eventually lead to various personal and romantic entanglements.
The legal advice would be: don't. But, the modern workplace culture encourages being more then 'professional coworker' to your coworkers outside of the office. And I personally think it is a good thing because it makes workplaces more human. I certainly made some amazing friends (both male and female) at the places where I worked.
But, my question is: has anybody with legal and/or HR credentials and some ethical sense written any definitive guide what is OK and what is not specifically in the context of the modern office?
Yes, they have. I am NOT one of them. I don't have one of those guides. But I've received enough mandatory training to have a layperson's understanding of the baseline in my national jurisdiction which is USA. The baseline is twofold, it is fairly clear, and it is worth reviewing. Don't take my word for it, but I think if you check your authorities you may get confirmation.
First, no "quid pro quo." That is, you should steer clear of even the appearance that you will provide business advantage in exchange for affectionate acts from a person who is sexually attractive to you. This principle is an excellent reason not to ask an interviewee to go out on a date (slightly simplifying an example from elsewhere in recent Hacker News).
Second, no "hostile environment." That is, you should steer clear of even the appearance that you are making the workplace uncomfortable for people who are sexually attractive to you. Decorating your desk with a calendar featuring glamour photos of models, unless that is your duty in your occupation, is not a very good idea.