The Essential Guide to Coding (on Replit) on Your SmartPhone

One Mobile IDE to rule them all, One Mobile IDE to find them, One Mobile IDE to bring them all and in the dark mode bind them. — J.R.R. "133+ h4x0r" Tolkien... would totally have written LOTR in markdown on Replit

In reality, there are a number of options. Only one of those options is really a great one, so I'll be going over my favorite option extensively. I'm aware of options like Termux. If you have comparisons I'd love to hear them in the comments.

Also, note the bias I have as an Android user... Because I do not have an iPhone, I am not able to tailor any of my opinions or advice to iPhone users very well. Either way, I don't think you'll have much of an issue with the main option in this article.

Why Code on Mobile?

Why don't you mind your own business, huh Bucko?

Sorry, I don't know what came over me. I can assure you there are valid reasons to code on mobile other than the "I just want to be different" punk attitude. Please do not misconstrue my arguments to imply that mobile coding is the best option for everyone, when it obviously isn't. I'm just saying we live in a wide world, and for certain people it may very well be the best or even only option.

Psychological Inertia, It's a Thing

At the intersection of some types of busy lifestyles (not all) and code editors like VS Code lies a heartbreak 💔 due to irreconcilable differences.

Such tools are so amazing that you can anticipate how frustrating it will be when you finally get a spare moment to lose yourself in the Code, only to be rudely interrupted and drawn out of your techno trance. Because of that anticipation, the moments where you actually let yourself take the "risk" of settling down for a programming session can become sparse, and so your productivity takes a hit.

Coding on your phone, well that's different. You're taking the programming workflow off of a pedestal. Not only is your phone more portable than your laptop, it's probably never gonna be as seductive as the glow of VS Code, Firefox, and Spotify on your ultra wide. That's a good thing if interruptions are inevitable for you because it's less heartbreaking when you do get interrupted.

The Duolingo Effect and Using Addictive Tendencies to Accomplish Stuff

You're probably addicted to your phone anyway. Instead of sharing boomer memes about the evils of smartphone addiction on social media — thus quixotically furthering your addiction — what if you used your addiction in a positive way instead?

That's one of the big ideas behind Duolingo, the free language learning app with the infamous green owl mascot. I'm sure most people use it on mobile phones. It is possible to use it on Desktop, and in fact I prefer that experience. But like many people I get more time on my phone.

The premise of Duolingo is, sure, you could scroll through memes and trade the funny ones with your brother... Or you could do something fun and productive in bite-size chunks.

Try to View the Ergonomics Optimistically

Typing with your thumbs on a software keyboard on a phone screen just generally isn't as conducive of long productivity sessions as time spent at a desktop setup.

Nonetheless, instead of focusing on that aspect, you should learn to play to the strengths of the mobile platform.

One hint at what the strengths may be can be derived from considering a major weakness of the desktop platform. I would wager that for many, a comfortable and customized desktop setup is so good at drawing you into a flow state while working that you can end up working for so long without breaks that you end up suddenly realizing that you are feeling a bit burnt out. So you take a break... But because of that burnout feeling, you may not end up even going back and sitting down to get back to work that day because of the subconsciously perceived effort it might take. No bueno.

A mobile-oriented workflow is far less glamorous and effective at drawing you into that flow state while working. It's very easy to anticipate the onset of feeling annoyed or negative in some other way because of the unique challenges of coding on the mobile platform.

So use that to your advantage. How?

Consider Temporal Motivation Theory:

Motivation = (Expectancy × Value) / (1 + Impulsiveness × Delay) wiki

Let's go over these, keeping in mind not too take it too seriously lest we start to look a bit silly:

Motivation ⬅️ You want to maximize this value, as it strongly correlates with productivity.

Expectancy ➡️ basically this is like confidence and optimism regarding the prospect of success. As this increases, so does Motivation.

Value ➡️ perceived benefit or reward that should result from success. As this increases, so does Motivation.

1 ➡️ a constant value added to the bottom half of this equation to imply, I'm pretty sure, that if you're actually quantifying these values you can't have the bottom half of this add up to zero. Which is a strange because the other terms could still make the denominator add up to 0. And you can't divide by 0. I wonder if something really dark and depressing happens if you divide by 0 in Temporal Motivation Theory world... or maybe I just invented time travel ⌛🧳

Delay ➡️ one of the most important factors, this is how much time to complete the task. Inversely correlated with Motivation. As you decrease the amount of delay (i.e. time) your Motivation increases. If you've ever heard of timeboxing or pomodoro, this is the variable those methods try to manipulate to your advantage.

Impulsiveness ➡️ this one is easy to explain. Hey, is that squirrel?

If you compare a desktop programming workflow to one on a mobile, you'll notice your perception of the delay associated with the mobile workflow is going to be shortest. This is because of how much of a hassle it is to code on mobile. It can be difficult to get into a flow state, and you're always anticipating that sooner rather than later your thumbs are going to need a break, even if you're mentally engrossed in a process of problem-solving.

My proposal is then that you should just stop worrying and accept that maybe a mobile programming workflow is one designed to be done in short bursts. Accepting that can give you a burst of motivation and energy when you have a spare moment to boot up one of your REPLs and add a few comments or lines of code. Set small incremental goals for yourself, and this becomes easy. Try to get in the habit of wrapping up your mobile coding session before it starts to feel annoying, and it will never feel annoying to you.

So timeboxing, basically.

Replit, duh

Replit has some seriously killer features and I shouldn't be saying this out loud but I honestly can't believe there's even a free option. I think there's even a free deal "Hacker Plan" subscription right now if you sign up through a student Github account.

At the risk of repeating myself and making this article unnecessarily longer than it already is, I'll just say I've already sang praises to Replit previously.

Ya Gotta Use the Hacker's Keyboard Though

It's free. On Android install it from the Play Store. You won't get by with gboard or whatever keyboard you're using. Hacker's keyboard is configurable and gives you access to "real keyboard" keys you'd otherwise be missing like arrow keys, control, shift, alt, tab, etc.

If you're on iPhone, not all hope is lost. You'll have to search the App Store and see if there's a suitable alternative for you. As a last resort, you can purchase an inexpensive foldable bluetooth keyboard off of Amazon and use that.

If You Aren't Using the Github Integration, You're Doing it Wrong

Make sure you're backing up your progress on your projects to GitHub frequently. If something goes wrong, GitHub is your backup plan and let's be honest the final destination for your code anyway. I haven't run into a single glitch yet while operating Replit's "experimental" github integration in mobile browsers.

Have Multiple Mobile Browsers

As a developer I'm sure this is preaching to the choir, but you should have multiple mobile browsers installed — even if you aren't using Replit to develop web projects.

It's irresponsible not to. As much as I try to avoid Chrome (I'm a Firefox hipster) I still have it installed just to be safe. If I make a huge part of the workflow for a project based on the usage of a platform through a mobile web browser, then I should always keep my options open. On the off-chance something goes wrong with Replit in one mobile browser, I'm not completely blocked from mobile productivity if it still works in another browser.

Always Define an Explicit .replit File

The .replit file is not required to be defined in the root directory of all of your REPLs, but you should pretend that it is. Read more about those files here.

We're trying to make the most of a less-than-ideal situation, right? So this should be part of your redundant safeguards to the productivity of your mobile workflow.

By default, if you don't define such a file, tapping the Replit "Run" button will simply run whatever the default entry point is for the language you're working with (e.g. main.py in project root for python). However, even if that's all you think you'll ever really want to do with the run button, define that explicitly anyway. For example, in python your .replit file would then look like this:

run = "python main.py"

What is the advantage of this?

Well, on mobile, so far as I can tell currently you don't have direct access to your REPL's shell like you do on desktop. That may be fine for many projects.

But imagine that for a moment you encounter a glitch in your mobile web browser where you have trouble using the interface to create a new file (or some other bug). In that case, if you don't have access to the shell on mobile to use a touch command to create a new file, then you are at a productivity standstill if you also don't already have a .replit file to change quick to a script like the following to create the new file for you when you hit the run button:

run = "touch newfile.py"

Thanks for Reading

Thanks for reading. I know there are lots of options out there and this article is a bit opinionated. Have you ever found yourself needing to code on mobile? What are your experiences? Let me know in the comments. If you found this article helpful, help me in return by liking and sharing.