As far as costs are not excessive it is a bit like gambling with fewer risk. But in the case electricity is expensive in your country or, like mine, you have to pay $350/montly just to get "permission" to mine, it is possible that with most of the altcoins mined you can't cover the costs because they'll not even be listed in any exchange. If your situation fits more with the second example, it could be better to simply buy and hodl crypto with the money you were thinking to invest in mining.
Do your maths taking into account that the risk is high. Don't spend mining the money you can't afford to lose.
What? Are people actually paying 350$ per month on electricity in some countries? That's a killer bill I would rather so build inverter and solar panels, in my country electricity costs around 15$ to 25$ per month