Many personal finance experts speak out against using credit cards. Dave Ramsey, for instance, takes an extreme view against any debt. In one blog post, RamseySolutions.com stated, “Life is better without credit cards.” The post asserted that people don’t need even one credit card if they build emergency savings and pay cash for everything.

Likewise, billionaire investor Mark Cuban agreed with Ramsey on an episode of The Ramsey Show. “If you use your credit cards, you do not want to be rich,” he said on the podcast. “That’s my favorite line; I tell it to people all the time.”

Roughly a decade ago, Cuban said he wished he had known the evils of credit card debt in his 20s. “I should have paid off my cards every 30 days,” he said in a Business Insider interview in 2014.

He pointed to high-interest charges thatcan keep you from building wealth. He has also said that the best financial investment you can make, at first, is to pay off your credit card debt. “Your credit card, you know what your return is,” he told Ramsey. “If you’re paying 15%, 20% interest, if you pay that down, you just earned 15% or 20%.”

Are Cuban and Ramsey Right About Credit Cards?

Conventional financial wisdom often touts the benefits of a high credit score, which you can only build by using credit responsibly.

“For many average Americans, buying a home is a major part of their wealth building plans, and not being able to establish a credit history will make it harder to get good rates,” Colin Palfrey, chief marketing officer at Crediful, previously told GOBankingRates.com.

But more than building your credit profile, which can lead to benefits like more affordable mortgage rates, using credit cards responsibly can help shift your money mindset, according to experts.

Matt Bruce, CFP®, AIF®, president of the Pointer Financial Group, previously told GOBankingRates that learning to manage credit responsibly can help build financial discipline. “I’ve never worked with a wealthy client who didn’t use credit cards responsibly. It’s not that using or not using a credit card that builds wealth, it’s that the ability to responsibly use credit is a determining factor in the ability to generate wealth,” he said.

The Secret to Building Wealth, Per Cuban

Financial experts agree that Cuban is right on at least one point: You should always pay your credit card balance in full before interest accrues.

Once your credit cards are paid off, you can deposit that money into a high-yield savings account, where you will have easy access in an emergency and earn a return on your investment.

Spend more than you earn and then put your money in an account that will work for you, building wealth as interest compounds.