I purchase a bunch of technical books in digital format, but I always skip books which are not DRM-free and don't deliver at least PDF and EPUB formats.
It is true that code examples look broken at times, but most of the times turning the kindle to landscape orientation does the trick.
You should avoid feeding PDFs to your Kindle, since they only look good on a PC or on a 4:3 tablet (ex. iPad or Galaxy Tab S2), although, after reading a chapter on your Kindle, it is positive to skim through the PDF to get a grasp of the details you might have missed.
As a Kindle owner, the format you really want is .MOBI (or .EPUB converted with kindlegen[1] and trimmed down with kindlestrip[2]).
Most .MOBIs you'll encounter are actually conversions from .EPUB with kindlegen, so you should trim them down with kindlestrip too.
Finally, if you're a Kindle power user, then you should give Calibre[3] a try to convert other formats to .MOBI, but be warned that the conversion is a hit-or-miss.
[1] https://www.amazon.com/gp/feature.html?docId=1000765211
[2] https://pypi.python.org/pypi/kindlestrip/
[3] https://calibre-ebook.com/