The workplace can be a difficult space to operate from a social perspective. You always want to be friendly, but there are some topics that are simply inappropriate for the office.

Sometimes without even knowing it, people say things to coworkers that could be considered inappropriate or discriminatory, even to the point of leaving their companies open to employment lawsuits.

Below are eight discriminatory things you or your coworkers might be doing that you should avoid. Keep in mind that employment laws vary from state to state, so what might be illegal in one place could be merely rude and inappropriate in another.

1. Asking someone when they plan to retire.

This can be construed to mean that you think your coworker or employee is becoming too old to work, a sentiment that violates the Age Discrimination Act of 1967, a federal law that applies to workers over the age of 40. While discrimination based on race or sex is often more overt, age discrimination can be as subtle as referring to someone as "past their prime" or "over the hill," or repeating the old maxim that "you can't teach an old dog new tricks."

In general, it is best to avoid remarking on people's age, unless their age is demonstrably relevant to their ability to perform a certain job function.

2. Making fun of someone's whiteness.

While there might not be much actual harm in referring to your coworker's brunch habit as "so white," the Civil Rights Act of 1964 protects Caucasians from discrimination the same as it does people of any other race. One such instance won't be enough to get you sued, but repeated harassment could lead to your office being deemed a "hostile workplace environment" for white employees. 

In 2012, the County of Kauai, Hawaii paid out $120,000 to settle a reverse racism case brought by a white county lawyer who said one of her bosses allegedly told her she needed to assimilate better with the local culture and dump her white boyfriend.

3. Making positive generalized statements about an ethnic group or race.

The phrase "you people" is never a good idea because it makes it clear that you are classifying an employee in a given group with a set of pre-defined traits. Even if those traits are positive (i.e. "you guys are such hard workers"), it could lead others in your office to wonder whether your judgments about their race influence how you think about their work..

4. Repeatedly asking about someone's family health history.

Most people haven't heard of genetic discrimination, but the Genetic Information Nondiscrimination Act of 2008 protects workers from being targeted for their family health history (i.e. a worker who is more likely to have breast cancer because it runs in their family). While off-handed remarks or light teasing are not actionable, repeated inquiry about an employee's susceptibility to various diseases could constitute harassment.

In addition to directly hectoring employees about their genetic information, the Texas Workforce Commission advises against discussing an employee's health conditions with others in the office.

5. Commenting on a coworker's appearance.

In the age of email and instant messaging, it can be hard to interpret tone in online communications, making comments about a coworker's appearance even more risky.

While you may mean it to be an innocuous compliment, a comment like, "that new outfit looks great on you" could be seen as having sexual intent if the person you're making it to can't read your body language as you say it.

If nothing else, these kinds of remarks can make your coworkers uncomfortable, unhappy, and unproductive. At worse, it could be considered sexual harassment.

6. Using gendered language.

It can be commonplace to casually describe a whiny client as "acting like a little girl" or an unpleasant boss as "being a total bitch," but these words carry a gendered connotation that could lead your coworkers to believe you think that only women are capable of being rude or whiny.

Additionally, certain characteristics can be interpreted differently for men and women, such as how an assertive man can be seen as "a leader," while an assertive woman is thought to be "bossy."

Be careful to avoid these misunderstandings and hurt feelings by saying exactly what you mean in a clear, gender-neutral way.

7. Asking someone to speak for the people of their race/ethnicity/gender/sexuality.

Perhaps there's a hot-button social issue in the news and you'd like to know what your black/Latino/gay/female coworker thinks about it. This is fine, but don't make your query about their status as a minority. Whatever you do, don't start your sentence with the phrase: "As a [black/Latino/gay] person ...."

This can single out your coworker in an unpleasant way. Plus, no group is a monolith, so it's probably not helpful to get one person's opinion and extrapolate it across an entire ethnicity, gender, or sexual orientation.

8. Asking people about their religious beliefs.

While it's fine to ask people what they're doing over a holiday break, it's best not to seek specific details on people's religious beliefs and practices unless they bring it up first.

Expressing too much interest can give the appearance that your opinion of a person (and potentially their job capabilities) hinges on their beliefs. Repeated comments about someone's religion can also be considered harassment, which can become a problem since religious discrimination is outlawed by the Civil Rights Act of 1964.

More from Business Insider