I've been programming on my phone with termux + vim. It's been sort of a delight.
Seconded.
With Termux (https://termux.dev/en/) I have C, C++, Rust, Go, Perl, Python, Ruby, and more in my pocket.
The screen is small, but the tools are mostly the same you would find on your favorite *nix box.
No network connection needed beyond getting the packages you want installed.
termux also has emacs, nano, and a few other text editors.