Desktop is cheaper and may not have problems with overheating, might be easier to upgrade it. Laptop is better if you need to work outside of your home/office, laptop can eat less electricity and be easier to be stolen.
It is better to go for a laptop because you can carry laptops along with you, you can work where ever you want and it's make easy your work accomplished
In my opinion now a days both are equally capable to perform any task, we can't say which one is better, its all depend on you needs and choice. Thats it!!!