It depends. For programming in general, any current computer can do the job, so if you travel a lot, a notebook is better, but if it's a home office or the company provides a work notebook, I would go with a desktop.
This is for programming in general. For game development, for example, I would consider a desktop. Only in cases where mobility is really very important would I consider a gaming notebook