My corrected vision is 20/20 and I find the Nexus 9 to be a decent size for textbook reading. It was my go-to study tablet for about a year and I only gave it up because I switched to the iOS/Mac OS ecosystem. 10" devices like an iPad are even better.
Now my definition of a small (portable?) tablet would be one that I can comfortably hold width to width with just one hand (I have very slightly smaller than average male hands). Both the 8" iPad Mini and 8" Galaxy Tab S2 fit this description for me, but the Nexus 9 does not. But my problem with 8" tablets for textbooks is that I notice myself leaning in to read them. Although I can read them just fine if I lean in, I'm not going to sacrifice my back for the convenience of a smaller tablet.
The Nexus 9 doesn't fit my definition of a small tablet, but it's what I'd recommend minimally for a tablet to read code off of. An 8" tablet with a wider aspect ratio might make the cut for videos since there won't be giant black borders, but the lack of vertical space will quickly get to you when you need to reference code off of Websites. And compared to the original 2010 iPad, the Nexus 9 is a heck of a lot more portable anyway.
IMO you should give the iPad Mini a spin and load up some YouTube tutorials since it's in just about every electronics retailer. If you don't fall in love with the size, then spring for something like the Nexus 9 or bigger.