Only drawback for your use case is the programming part. Though you could also get a small Samsung or Lenovo 8" Android tablet which would give you much more flexibility. There's also the 8" laptops from a few niche companies, though they will probably be thicker than tablet + keyboard case and wouldn't have the same battery life or cellular options.
Smallest, easily available device I can think of in this form factor is a 7" Amazon Fire with the Zagg hinged keyboard case. It's slow, has so-so battery life, and you'd still need to get a cellular connection elsewhere. But it's about the size of a VHS tape and it's pocketable. I had one for a while because I wanted a cheap tiny laptop. Fire tablets are easy to turn into mostly generic Android machines so it would be useful.