Live data from Hacker News

Ask HN: What do you do while your code compiles?

news.ycombinator.com

11–20 of 28 posts

Re: Ask HN: What do you do while your code compiles?

#11

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.

(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.

Re: Ask HN: What do you do while your code compiles?

#14
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".

Re: Ask HN: What do you do while your code compiles?

#15

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…

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.

Re: Ask HN: What do you do while your code compiles?

#16

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.

In general I find that C# builds are fairly quick. Nonetheless Ruby is a pleasure to work with.

As for other interpreted languages, JavaScript is a mixed bag. The Webpack/Babel stack can be smooth if hot reloading and such are set up well and work correctly, but things can quickly turn sour when other backend languages are involved with server side rendering and such.

Re: Ask HN: What do you do while your code compiles?

#20

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.

In general I find that C# builds are fairly quick. Nonetheless Ruby is a pleasure to work with. As for other interpreted languages, JavaScript is a mixed bag. The Webpack/Babel stack can be smooth if hot reloading and such are set up well and work correctly, but things can quickly turn sour when other backend languages are involved with server side rendering and such.

I see you've never worked with mister "creates a project for every class" or any of his friends. C# compiles quickly, but MS build is very slow and it's noticeable when there are a lot of projects.

Just for fun, try compile with csc directly one day, it's an order of magnitude (at least) faster than with msbuild.

Post reply on HN