Coding on the go

When I'm on the bus, or on my break at work, I try to get some coding practice on my phone. It isn't ideal, but a bit of tinkering here and there lets me learn more about the languages I use, and can lead to coming up with small programming projects.

First of all, I use Android. I'm not a fan of either popular phone OS, but if given the opportunity to strip Android down to it's bare essentials I'll take it. From there I install the terminal environment Termux and the Hacker's Keyboard (both available on the F-Droid store), and then I install the programming languages I want in Termux itself, and I'm good to go.

My favourite language to play around with is Racket, but that's because I already use Racket everywhere else. It has an interpreter to see your results in real time, it has plenty of built-in functions so you don't have to key out extra functions, and it's easily available through Termux's repos. So far I've built one application through playing with Racket on my phone, an Islamic prayer times calculator that grabs information from the AlAdhan API and presents it in the terminal. I am currently playing around with a program to generate Markdown, though I don't expect it to become anything fancy.

I've also had fun working with more unorthodox languages, like Forth. Working within the limits of a language so different from ones I'm used to is a puzzle in itself. I hope to start experimenting with Rust, Prolog and Perl6 in the future.

The fact that Termux allows users to write their own command line applications is appealing to me, because it means I can develop “apps” on the device itself, without knowing any Android specifics. It's a great time-waster, and allows me to be ever so slightly more productive.