5 ms·
It's not difficult, but it's disrupting to your coding flow, which is bad in itself and even worse when prototyping.
by oflor 4y ago
It's not difficult, but it's disrupting to your coding flow, which is bad in itself and even worse when prototyping.
- throwawaymaths 4y agoMore disrupting than a really slow compiler?
- adgjlsfhk1 4y agoallowing undefined variables doesn't slow down the compiler.
- TakeBlaster16 4y agoYes. If Zig takes 100ms to compile, and Rust takes 2s, but you just spent 20 seconds commenting unused vars in your Zig code, then the slow compiler comes out ahead. It's a great example of how good UX can be more important than raw performance numbers.
- throwawaymaths 4y agoYes, but you comment out unused variable once per variable (you can leave those underscores in and clear them out before release). The 2s happens every time you compile. The badness of slow compiles is non-linear, too. As you start to get to 30s, the likelihood that you check Facebook, Twitter, or hn goes up. At least when you're underscoring unused vars you're doing something active. If it gets to 2-5 minutes the likelihood that you stop writing tests and rely on the compiler for bugfreeness goes up - or the likelihood that you create debt by increasing the complexity of your code organization.
- TakeBlaster16 4y agoStrawman. Incremental compile times don't hit 2-5 minutes in either language, otherwise it obviously wouldn't be viable for real-world use. And juggling variables was an ongoing ordeal when I tried. I can't imagine how you would work on code without changing any of the variables.
- throwawaymaths 4y agoIt's really not a problem for me. I've worked on probably about 20k LOC of zig. Probably the one time it was an issue was when I wrote some code that wrote zig -- and then it pushed me into realizing that this was a code smell, and a refactoring fixed it. Compile times of 2-5 minutes can happen in langs that are not rust. You mentioned rust, not me. And anyways the 30s to hn thing is real.
- alpaca128 4y ago> (you can leave those underscores in and clear them out before release) You can leave those "unused variable" warnings and fix them before release The difference is that warnings are visible, the underscores however suppressed the compiler's ability to help you.