Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Compiling

But seriously, what do you do during compiles or lengthy test runs except slacking off? I tried different approaches, but each has some flaws.

  • Just wait: It's difficult to just stare at the screen and do nothing.
  • Check email: This gets you out of the flow and doesn't give enough time to get the inbox to zero, in result you will have to process stuff more than once.
  • Check the news: Before you notice you're going to have dozens of new browser tabs open.
  • Take a walk: Probably the most healthy option, but you don't know when to return.
  • Continue with coding: Seems most productive, but often you will have to backtrack a bit or switch context when the build completes.

PS. To be more specific, I'm thinking about builds taking 5-15min, and by build I mean both compilation and a full test run necessary before commit.

share|improve this question
1  
I love python :) – Daenyth Sep 22 '10 at 23:34
2  
@Daenyth: Me too, but not without a good test suite. – Adam Byrtek Sep 23 '10 at 0:20
3  
hehe what about writting a plugin that sms you when the build is done so you can return from your walk :P – Francisco Noriega Sep 23 '10 at 1:47

closed as not constructive by ChrisF Nov 17 '11 at 11:22

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

13 Answers

up vote 11 down vote accepted

I usually fix bugs that I've spotted just after running make.

share|improve this answer
4  
True, I often ^C the build because I already noticed that it's going to fail. – Adam Byrtek Sep 22 '10 at 23:33

Blink

Because I work with server-based languages, and it takes just a moment to refresh a browser.

share|improve this answer
Don't you write unit tests, not to mention Selenium testing? By build I mean more than just a compile. – Adam Byrtek Sep 22 '10 at 23:29
3  
Of course not, my code works perfectly every time! :> – Peter Boughton Sep 22 '10 at 23:30
But no, where I work doesn't have automated testing, despite my efforts. :( When I get my own projects going, I will of course be doing these things, but it'll be a post-commit hook, so there'll be no build delay, just a notification if anything fails. – Peter Boughton Sep 22 '10 at 23:30
+1 for such supernatural skills :) – Adam Byrtek Sep 22 '10 at 23:32

Rest my eyes.

For every 20 minutes there needs to be a 20 second rest, though our souls might have been meant for coding, the bodies... not so much :(

share|improve this answer

I spend most of the time trying not to think of penguins. It's hard.

share|improve this answer
1  
Unless you're a Linux programmer, this is odd. Then again, if you're a Linux programmer, you're odd. ;) – Jasarien Sep 23 '10 at 10:52

I suggest that if you consistently have 5-15 min compile and test cycles, you take on two projects/stories/features/issues in parallel and toggle between them. Depending on your environment, there should be some ways to get extra tasks that don't interfere much with your primary one. You might have a backlog of smallish bugs, for example, or you could refine the documentation or the tooling. Yes, there will be some mental context switch, but it can't be worse than spending what might be 30% to 50% of your day essentially idling.

share|improve this answer

Eat.

Chances are, once the build's done I'll need some energy...

share|improve this answer
Haha. Will upvote in 25 minutes when my timer resets – TheLQ Sep 22 '10 at 23:35

If you believe my blog title, While I Compile; I compile my thoughts. ;-)

In reality though, computers and compilers are so fast now a days, that even rather large projects don't give you a whole lot of time to do stuff like write SO answers, have a sword fight, or as some former colleagues used to do; play soccer /w a crumpled up piece of paper.

Short answer, other than a quick bathroom break, grabbing a glass of water, or Twitter; not much.

share|improve this answer

**COFFEE**

Seriously, we started a clean sheet of paper project recently with nothing to compile other than what we've done in the last 3 weeks (read:15seconds or less to build and about 30-60secs to run UTs)... my coffee intake is down to 1/2 of normal. Made me realize how often I get another cup just to fill in the time.

share|improve this answer

Posting on one of these sites.

share|improve this answer

I just wait, because it's rare for a build to take 5-15 mins, even on gigantic projects.

share|improve this answer
OK, why the downvote? Is there something inherently wrong with working in a compiled language where long build times simply don't exist? – Mason Wheeler Sep 23 '10 at 1:50
1  
What about tests? You do have tests, right? – imgx64 Sep 23 '10 at 9:54
Tests don't necessarily require a long build time! – configurator Sep 23 '10 at 10:41
@imgx64: Tests aren't part of the build process. That's a separate step. – Mason Wheeler Sep 23 '10 at 12:01
1  
to quote OP(emphasis mine), "But seriously, what do you do during compiles or lengthy test runs except slacking off?" – imgx64 Sep 23 '10 at 12:49

Browse SO and try to answer some questions.

share|improve this answer

I do mostly embedded programming in C, where a complete build of the system (compiling all modules and linking) takes under 10 seconds. Downloading to the target takes a few more seconds.

But I remember back when I started programming (40 years ago), submitting batch runs on an IBM-360, if you were lucky you got two compiles during the day (one in the morning and another in the afternoon), and maybe another overnight. Spent a lot of time looking at memory dumps printed on green-bar line-printer paper.

Then switched to embedded programming a few years later. Compiling might take a half an hour, programming another ten minutes but only if there were blank EEPROMS's available. Otherwise would have to erase some first. Spent a lot of dump looking at hex dumps in the emulator.

In each case I would usually find some bugs by the time the build was finished, and either work around them or start over again.

share|improve this answer

I check my (work-related)emails, and if I don't have some and the build is long enough I check work-related news, that is programming articles.

As I stay in the programming state of mind, the switch cost is really low and it allow me to continue to learn out of my own code while working.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.