Ask HN: What do you do while your code compiles? - rsp1984
======
Jtsummers
Figure out why it's taking so long to compile and what can be done to either
shorten it or automate the build and testing process so I'm not waiting for it
anymore.

Move things to unit tests with smaller compilation units (so I can compile
foo.cpp and a handful of other dependencies, but not the full system) so,
other than for deployment or integration testing, my feedback loop is much
shorter.

Or if it can't be made shorter, work on another project or read something
(presently non-practical/actionable, _Weapons of Math Destruction_ , but
typically more practically technically oriented).

~~~
sjmulder
A project I'm working on now relies on a third party platform that takes
fairly long to reload after changes. I've managed to run some parts standalone
which has been super helpful but in general there's a lot of waiting.

In the meantime I do small and very easy coding exercises.

------
borplk
Sword fight with my co-worker!

~~~
cynicaldevil
For the uninitiated: [https://xkcd.com/303/](https://xkcd.com/303/)

------
shubh2336
I guess that's one of the advantages of interpreted languages over compiled
languages.

I spend no time waiting for compilation to happen (ruby). I used to spend a
lot in my previous job (C#), where the time was utilised (wasted) in going
through blogs/articles.

~~~
Jtsummers
(NB: Not a criticism of interpreted languages, they add a lot of value)

While long compilation times are incredibly annoying, compilation offers a
first pass test on code: Is this code syntactically correct? Do (at least some
of) the semantics make sense?

With an interpreted language, you may be able to test for syntactic
correctness with a simple scan over the language, but you're approaching
compilation at that point. More likely, syntactic correctness is verified by a
test suite that's sufficient to provide 100% code coverage (which can be hard
to build and maintain).

It's also harder to know if a reference to _foo_ is valid at any point, until
it's executed. Which is where the semantic validity and verification of
compilation comes in handy. A tool which can do this for your interpreted
language is most of the way to being a compiler, it's simply lacking the
translation step.

The nice thing with interpreted languages is that you could put off a lot of
this verification/validation, similar to the distinction between dynamic and
static typing, until you actually need it. The debate is when you need it and
how much value is added by putting it at the start. But languages like go and
incremental compilation being adopted by more compiler/toolchain developers is
at least cutting down on the time to reduce the time spent idling (as a
developer) in the feedback loop.

~~~
lordCarbonFiber
Yeah, I laugh every time someone says interpreted languages remove the
"compile time" step. Once you decide to start working at scale you have to
come back and hack in all the static checks the compiler would have given you
for free and in my experience those tend to be 10x slower. I know running the
python linter + test suite on our basic enterprise CRUD takes longer than all
but the biggest C++ projects I've ever seen.

------
ap46
Android Studio users-----> Modify the HEAP_SIZE in the gradle file. It will
shorten build times by a factor of 3-4.

------
7ewis
Carry on as usual.

My code gets offloaded to a build agent, so I don't have to worry about it.

------
ravinizme
Write tests, Run the "compile" & "test" in the background. Than you can
continue working on your tasks (even other tasks while they are working).

Even better, just have a CI that will run it not on your environment.

------
Artlav
The largest personal projects i worked on were in the range of 100k lines,
which takes 3-4 seconds to fully compile.

So, i dunno. Stare at the screen?

------
EliRivers
If I'm feeling like being productive, switch to another instance of my dev
environment working on a different branch of the source code, in which I'm
working on a different problem entirely. It's just two (or more) branches
being developed on the same machine in two instance sets of my dev env, side
by side.

Usually, though, I do that thing where you open your mouth in different shapes
and smack the sides of your face to make noises. I'm trying to play "The
Entertainer".

------
ohyes
I read through my code to debug it.

------
gumby
Since my computer's working but I am not, I do something NSFW.

------
Kristine1975
Browse HN, d'uh!

------
AngeloAnolin
Being here in HN!

------
joezydeco
This.

------
azeirah
Minesweeper

------
telebone_man
Any opportunity to post an XKCD comic...

[https://xkcd.com/303/](https://xkcd.com/303/)

------
smnplk
i take a nap

------
kartiksura
make -j8

