Which is best for mining bitcoin? I am wanting to buy a hardware for mining bitcoin and namecoin using Bitminter. But then Genesis Mining offer online cloud mining. I want to know if it's better to buy a hardware for mining bitcoin or use cloud mining?
If you don't already agree with the above answers and understand why they are true, I recommend strongly rethinking the idea of mining. Before investing a single cent into mining, please invest in yourself, and your comprehension of btc first. 

If you're mining simply for the enjoyment of learning about this fascinating technology than I recommend mining yourself, and taking it very slowly. By this I mean to acquire an insignificant amount of hashing power (such as an ASIC thumb drive or similar) to get your feet wet, one that will not burn your house down or set your finances on fire. 

Bitcoin mining is a deeply complex field and for the uninitiated its a surefire way to burn up.