Starting May 15, New York City will require every job posting to be accompanied by a minimum and maximum salary for the position.

Colorado, Nevada, Connecticut, California, Washington and Maryland already have laws requiring some salary-range disclosure; Rhode Island will join them at the start of next year. Similar laws are under consideration in Massachusetts and South Carolina.

In most cases, the objective of the new rules is to narrow the gender wage gap: If companies are obliged to publish salaries, they will find it harder to underpay women. But more generally, young employees will benefit from knowing what they and their peers are paid.

Bloomberg Opinion columnist Sarah Green Carmichael discussed salary transparency with Bobby Ghosh in a Twitter Spaces conversation. This is an edited transcript.

Ghosh: Salary transparency is an issue that in recent years has been connected very much to discussions about salary disparities between the genders. A number of American states have laws requiring various degrees of transparency, and the European Union is discussing new rules quite along those lines. New York City has a law that will go into effect in in May. But your piece is about more than one city trying to fix a problem.

Green Carmichael: Yes, it is. Different parts of the U.S. have different types of transparency laws, so we’re able to see which ones might work better for which groups. In some places, the law says that if you get past the first-round interview, the company has to disclose the salary range. Elsewhere, companies have to disclose this to employees, but only if they ask.

The New York City law goes further by requiring that companies post a salary range when advertising an open position. That makes it much more useful for people, in all kinds of companies and industries, to know what those sorts of jobs pay.

Ghosh: Is the main objective of this law to address gender disparity in salaries?

Green Carmichael: That’s certainly the emphasis. Even when you control for education, industry or job title, the bottom line is that women aren’t making as much as men. And when you look at it by race, it’s even worse for women of color. If a white woman makes 70 cents on the dollar compared to a white man, a Latina woman makes only 54 cents. So, gender disparity has been out front as the rationale for the law, but there are racial gaps as well.

And salary transparency laws have a huge effect on young workers of all genders and races. It’s often younger workers who have the least information about what jobs pay.

Ghosh: Yes, those who’ve been working for a few years have networks of coworkers and peers, and maybe have changed jobs once or twice, so they have some knowledge, however imperfect, of what they ought to be paid. But young people who taking that first step of their careers usually do so in complete darkness about salaries.

Green Carmichael: This is an area where sometimes a little information can be more dangerous than none. If you have one data point — if you’re anchoring your expectations to what your college roommate is earning — that might skew your whole perception. Companies tend not to negotiate with younger workers, who don’t have much leverage.

Even when young people are choosing what to major in college, many of them don’t really know what they’re getting into. For example, the number of people who major in business as undergraduates has skyrocketed over the past 15 years, yet that pays roughly the same as philosophy, history, English, psychology — all these humanities majors that we think of as being maybe not the best investment.

A couple of weeks ago, a travel writer disclosed her salary on Twitter: It was US$107,000, and a lot of people were surprised that you can make six figures as a travel writer. That would be great news to someone who was considering that as a career, but had been told journalism doesn’t pay.

So salary transparency is very helpful — whether you’re still in college and trying to decide what to study, or just out of college and wondering what career to pursue. It would give some people the courage to pursue their dreams if they knew what the upside was.

And it’s especially important because we know from the data that the first 10 years in a person’s career are very important to establishing an earning trajectory. So, the sooner you have this information, the better.

Ghosh: That’s important, because if you start off underpaid, it’s going to take forever to catch up.

Green Carmichael: Sometimes people don’t catch up. And one of the things that’s really tricky about wage inequality is that it compounds over time. Even when you’re older and discover that you’ve been underpaid, it’s not always easy to then go to your boss and demand fairness.

Some states and cities have tried to combat this is by forbidding employers from asking for your salary history. This is a good idea, but clearly salary transparency laws need to go further.

Ghosh: There are many countries where it’s commonplace for employers not only to ask what your previous salary was, but actually demand that you provide some proof, such as a salary slip. At the same time, they’re not obliged to tell you what they’re paying others in the same position.

Another point worth going into is that a lot of people work under the assumption that they’re not being paid fairly. That has a bearing on workplace morale.

Green Carmichael: People who think that they are underpaid have much lower morale, which is totally understandable. Surprisingly, a lot of people who are overpaid think that they are underpaid — they’re suffering needlessly.

If you’re an employer and you’re overpaying someone, you want them to know how lucky they are. This is another area where a little more daylight on what people earn could benefit the people who have, so to speak, won the salary lottery.

Ghosh: What about online databases like Glassdoor or Fairygodboss, which have crowdsourced data about salaries?

Green Carmichael: I’m grateful that these organizations are trying to solve this problem — but it may be a problem that’s beyond private industry’s capacity to solve. With crowdsourced data, isn’t always clear exactly where a job is based, how many years of experience an employer requires, or what kind of responsibilities are included. I know from my own career as an editor that the same job title can mean really different things at different organizations. It’s better than nothing, having crowdsourced data. But if you’re using it to negotiate your salary, you don’t really know how trustworthy those numbers are.

Ghosh: When New York City’s law goes into effect in May, and new job postings go up with salary information attached, some people already working in those companies might be in for a rude shock. They’re going to discover that they’re underpaid — and that will have consequences for their managers and their human-resources departments.

Green Carmichael: I hope companies are taking this time to do what they should really already have done — which is to identify those who are underpaid and make it right before they find out the wrong way. Managers will soon be having conversations with people who discover they’re at the lower end of the salary range. They will have to be really clear about what employees must do to get to the top end.

I have talked to a lot of HR people about benefits and compensation, and with a couple of exceptions, they really care about people and want to do right by them. In some cases they may not know they’re underpaying people. They may think their company offers amazing benefits, but may be laboring under a mistaken assumption. Salary transparency will help companies, too. Employers who are generous will see even more people competing for spots at their firms. Companies that have been mistakenly thinking they offer great salaries and benefits might find they don’t stack up as well as they had assumed.