What do you do when you’re compiling code?

As an Android Developer, a lot of my time everyday is spent waiting for code to compile. For the longest time, I never gave this much thought. I would probably look at my phone, check out all my socials, and by the time I look up at my laptop again my brain is all fuzzy.

Hey, I’m writing this as code is compiling right now. I’m writing this article over multiple sessions of “code compiling”. Is writing a blog post about your compiling code the best thing to do while code is compiling? Well it’s certainly not the worst, but there are much better things to do.

What you don’t want to do is do something that disrupts your train of thought. You want to do something that keeps your focus on the work you’re doing. You want to still be fully connected with your code (not in the literal sense).

So after some research and a lot of thinking, I’ve gathered 4 things you can do while your code is compiling in order to stay productive during and after your compiling sessions.

These 4 things are in order of priority. I determined this order by how well each action keeps your train of thought and allows you to spend your compile time productively.

NOTE: These are for short (and potentially frequent) compile times; ones that aren’t long enough to warrant a ‘break’. As a TLDR for how to spend those longer compile times like project builds or running test suites, my suggestion is to make tea or go for a walk.

1. Look at your code

A MacBook with lines of code on its screen on a busy desk

This may seem both obvious and totally useless, because if you’re just looking at your code, you’re essentially doing nothing right? Nope, wrong.

Look at your code. Look at it from angles, top to bottom. Do you understand your code? Could you improve your code? Will you easily understand it when you look at it again a week from now?

All too often we feel pressured or we get lazy… or both. In these instances, we commit code that is far from finished, far from clean, far from optimised.

So take this moment to stop and think: should I spend more time giving more love and care to the code? And how exactly can I do that?

2. Move around

How long are you sat down while you code all day? The human body isn’t geared towards sitting down all day and on top of all the physical implications there are of doing this, it can very quickly make your mind feel stale and burnt out.

Stand up. Walk around a little bit. Maybe do some higher intensity workouts like push-ups. Compiling code is a perfect time to get those gains you’ve been thinking of getting for the last 5 months.

Wanna know some of my favourite workouts to do in front of my desk?

  • Push-ups
  • Planks
    Plank Abs Sport - Free photo on Pixabay

Honestly speaking, it’s really just these two. I save the rest (these still included) for my HIIT workout sessions.

That being said, the beauty of this is that you can let your body do this strenuous physical activity without spending much mental effort. You’re not refocusing your mind into something else, so you can complete your set and get back to your hopefully compiled code.

And if it hasn’t finished compiling yet, you’ve got enough time for a few more reps.

2.5. Stretch

Office Stretches on Behance

Arguably more important than the workout itself is the stretch. Sitting down for long periods of time our muscles can shorten and become tight, and over a long period of time, you’d be risking joint pain, strains, and muscle damage.

Learn some simple stretches to conduct while your code compiles to keep your muscles flexible, strong, and healthy.

3. Write Documentation

If you often find yourself in long or frequent compiling sessions, there is literally no better time than this to write some documentation for your code! It keeps you on your train of thought. It makes you think more about your code, it helps you understand it better, and you get to write documentation!

I also cannot stress how important documentation is for code. Too many a time have I seen newcomers into projects and it takes them so much longer to understand the codebase because there’s too much domain-specific knowledge that isn’t documented.

Write documentation lads.

4. Expand your technical knowledge

File:Galaxy brain female stage 3.png - Wikimedia Commons

Compiling code can also be a good time to go online and browse stack overflow, developer documentation, and coding blog sites to learn more about what you’re coding.

Do use this technique carefully though. Remember that it’s important to keep your mind focused on what you’re doing, so if you’re going to learn more about certain technologies, keep it in the scope of your current task.

Try not to go on too much of a tangent from what you’re working on or even worse, definitely do not start heading to your socials or browse random subreddits. Your focus is so important and I cannot stress that enough!!

Conclusion

I am a fan of the pomodoro technique (the 50 minute version specifically). For the unknowing, the pomodoro technique requires you to work in focused 25/50 minute sessions without breaking that focus (not even for a pee-break).

I devised this list as a way to stay energised, focused, and productive within those focus sessions whilst compiling code.

If you liked this list, please do share it in some random subreddit, idk or idc where but do tag me. I would appreciate it.

And comment down below some of your own techniques for spending compile sessions productively.