Yes they are both risky but gambling has higher risk. But if you are wise enough you will going to have the most profitable way and that is for having investment, so while you are into gambling. Even you are going to lose you have the chance to recover it by means of getting profit from your investment.
It can be for other people but with my stand better to be safe rather than to believe with a false belief that gambling is shortcut to success. There might be scenarios that it can was proved by people who won big amount in lottery. But still it is better to get your own source in a strong source, which is investment while you are into gambling.
Yes it can be for those who have good experience in gambling but it is always better to have your decent way of getting profit if you are aiming for your way to become a successful person. And that is with proper money managing and investing into the right ones that fits you, since investing is already gambling your money but it has lesser risk that the real gambling.