While I like and upped Buffy's answer, I think there's a bit of a pattern that I follow that I'd like to share.
Unless hardware is specifically involved, or the course is heavy on theory, I prefer to avoid textbook use.
When I think a particular book will be useful, I may add it to a recommended reading list.
For Courses with Emphasis on Hardware:
If there is an emphasis on hardware, it is useful to be able to consult a reference. Diagrams tend to be very useful when discussing hardware implementations or methods. If I use a textbook, then the students have a reference they can consult, instead of just scurrying around the net for diagrams that may be incorrect due to poor google-fu.
Additionally, if a textbook is used, I don't have to worry about looking up copyright info for every image I use or distribute. Often this isn't a big deal, but it's one less thing to think about.
For Theory-Heavy Classes:
Perhaps theory isn't the best term, because in programming, the theory is so practically useful it feels almost wrong to use the word...
The long and short of it is that some concepts cannot be contained by a block of code. There are some texts out there, written by mountain-top CS gurus, that in a few sentences illustrate concepts that can quite literally change your life, your professional life at a minimum.
These concepts are best learned from those texts, and rather than beat around the bush, at least recommend them.
But do you actually need to use them?
After all that, you don't really need to use them.
I've seen almost every scenario. The class where there were some core concepts that code examples themselves could not contain, where there was no textbook. Students asked for a recommended text, to help them learn the concepts.
I've seen scenarios where there was a textbook, but the course was overly results-driven, concepts were glossed over, and textbooks were ignored and sold off.
Myself, personally, as a poor student, sold a textbook only to regret it a few months later, and I ended up buying it again. That's how important that book was to me.
Not all your students will appreciate a textbook, so perhaps make it a recommended read instead of a hard and fast requirement of your course, then supplement with your own digital notes.