Better how? They are build for completely different reasons, other one is keeping chain secure and other is being a liquidity provider. I don't think they are comparable in any other form than their APY
With staking your money is relatively safe, and while yield farming might give you way more APY, but at the same time your money is far from safe as there's a risk of impermanent loss. Not to mention possible DeFi protocol code vulnerabilities.
Based on what you've said, I think yield farming is a lot riskier than staking. That's because smart contracts are usually untested with a lot of vulnerabilities on them. I've seen many cases where hackers siphoned millions of dollars (USD) worth of crypto from a "De-Fi" platform. You don't hear that with native PoS coins.
While this is a fact, I'd have to admit that staking is becoming more centralized by the day. There are so many coins on the market that are controlled by a few players with a lot of money (mainly exchanges). ETH, and BNB are a good example of this. With yield farming, everything is done in a "non-custodial" manner. You'd have to verify and trust the smart contract yourself. Doing both (Yield Farming and Staking) will allow you to minimize risks of loss in the long run. And that's precisely what I'm going to do. Wish me luck!
There is merit in your observation that yield farming is fraught with risks, especially those emerging from the untested nature of smart contracts. The recent heists from DeFi platforms have indeed been alarming.
The issue of centralization in staking is indeed a growing concern. But consider this - is it the nature of the consensus mechanism, or is it reflective of the larger socio-economic inequalities? Perhaps its a systemic issue that transcends the technology.
Your preference for a non-custodial setup in yield farming, though appealing, comes with its own set of challenges. It demands a certain level of sophistication from the users which can be a high entry barrier for many. The strategy of diversifying between yield farming and staking appears prudent, yet the intrigue lies in the precise balance you strike.