You can easily use a laptop for coding, and in some ways, it is preferred. Desktops usually have better performance for a better price. But for programming, you don’t always need the best performance possible. Instead, the portability of a laptop might be more worthwhile for you depending on your situation.