I have always sought ways to turn mobile devices into develoment platforms. The outcome has been particularily good in one setup, which I’d like to describe here. You needn’t to know Haskell to read this article. I will be focusing mostly on the environment, its quirks and its surprising attractiveness for every curious programmer.
The problem
Tablets have almost all what is needed for an ultraportable development station. There is sufficient screen space and quite a lot of CPU power, the device is small and has stunning battery life. On the other hand, touchscreen keyboard greatly limits programmer’s capabilities. Touch typing is difficult and access to curly braces or other necessary keys is obscured, reducing the programmer’s speed to a hunt-and-peck.
This problem can be partially solved and the remaining bit can be turned into a learning experience. Notice, it’s not a complete solution; I don’t know how to comfortably compile C code or do web development on iPad. I can however present you a fun little workaround that has a practical side too.
Editor
First, let’s remember that we have fairly easy access to console and console programs. One can easily connect via SSH to an external server, or with a little more effort (jailbreak on iOS, rooting on Android) gain access to local command line. Let’s run an editor that is optimized for using as little keystrokes as possible. My tool of choice is vim and I have found that running it from an iPad causes me to think more about the commands I execute. It’s like a constant excercise in using your favourite editor while still doing actual work. And it makes you write faster too.
Conciseness
But do you write fast enough with a touchscreen keyboard and vim? For me the answer was “no”. Fortunately, one can pick a programming language that doesn’t require much editing. Java is out of the question, even Ruby proved to be too verbose, but Haskell worked perfectly. That was because of two reasons: Haskell’s impressive conciseness and the embarassing fact that I’m still learning this language. The latter causes me to pause and think more often during writing a program. In this case, it’s a plus.
What happens in console, stays in console
One more obstacle is left, multitasking. Programmer’s workflow frequently includes switching between editor, interpreter, documentation and the resulting program or web page. Let’s do another workaround and assume that we’re writing only console applications. This greatly limits our possibilities, but allows us to stay in shell almost all the time. And here we have tools that facilitate switching context, e.g. GNU Screen.
Result
The complete setup is as follows: a jailbroken iPad, Safari with Haskell documentation and iSSH application with local connection. In the console there is a Screen session running Hugs in one window and vim in another, with a Project Euler problem being solved. All console programs are installed locally and can run without network connection. Synchronizing and versioning files happens with git. Wrapping all programs in a screen session ensures that they keep running in background, giving the ability to resume work instantly (no need to navigate directories or open project files everytime). Every console program mentioned can be found in standard Cydia repositories and installed with ease.
I enjoy such workflow because of two reasons. Firstly, when I’m on the go I can continue working on same code that I have been writing on desktop. Secondly, I can overcome limits of the environment with the same tools that I use on desktop. The latter is especially interesting. Saving a few keystrokes in an iPad console does make a difference and using shortcuts is much more rewarding. You’re not only using experience from desktop to harnass iPad, you’re also learning in the harsh touchscreen console environment and with all what you learn there you can speed up your day-to-day workflow.
Your turn
Like it? Try it! Or experiment with a different toolset. Have fun!
