I assume that if you're trying to do this, you've got a keyboard attached to your iPad - I think I'd rather stick forks in my eyes than try to code with an on-screen keyboard. So at that point, why not just use a laptop?
The Apple folio keyboard is actually really good. Even compared to my 12" Macbook the 11" iPad Pro is still more portable, plus I use the Apple Pencil a lot.