4 ms·
Zig not having a text-based preprocessor is a feature, not a bug though. From the pov of a multiplatform coder who's used to exclude platform-specific code wit
by flohofwoe 4y ago
Zig not having a text-based preprocessor is a feature, not a bug though. From the
pov of a multiplatform coder who's used to exclude platform-specific code with #ifdef/#endif, Zig's behaviour is completely logical (because that's the only way it can work without a C-style preprocessor).
- stephc_int13 4y agoYes, this is the logical way of doing it without preprocessor. At the end of the day, this is pretty equivalent. Not sure if this is a net gain or not. Conditional compilation is needed, moving the feature from the preprocessor stage to a lazy evaluator is probably costlier for the compiler and it might also be costlier for the IDE to highlight active/inactive parts of the code. From the user point of view, this is very close, mostly a cosmetic change.