2 ms·
https://github.com/ziglang/zig/issues/544#issuecomment-618072318 https://github.com/ziglang/zig/issues/544#issuecomment-61807... > In order to simplify everyth
by alpaca128 1y ago
https://github.com/ziglang/zig/issues/544#issuecomment-618072318 https://github.com/ziglang/zig/issues/544#issuecomment-61807...
> In order to simplify everything, tabs are not allowed. Spaces are necessary; we can't ban spaces.
They seem to be open to the alternative but not to a solution that isn't forced on people:
> Maybe someday, we'll switch to tabs for indentation, spaces for alignment and make it a compile error if they are incorrectly mixed
Zig already has a builtin code formatter that automatically changes formatting to their preference, but that's not enough.
> That's the entire purpose of the concept of warning
Yes, but as far as I know the Zig compiler cannot emit warnings, only errors. Because warnings are potential footguns too and we can't have that.
- littlestymaar 1y agoUgh. Thanks nonetheless.
- const_cast 1y ago> Yes, but as far as I know the Zig compiler cannot emit warnings, only errors. Because warnings are potential footguns too and we can't have that. Okay they're kind of on to something here, because in my experience with C, warnings just get ignored. And you only get warning if you're doing something really suspicious in the first place. Every serious C project I've worked on has used -Werror.
- littlestymaar 1y ago> Every serious C project I've worked on has used -Werror. -Werror is a good default for CI, but not for local development.
- const_cast 1y agoYeah I would agree, same with unused variables.
- alpaca128 1y agoI 100% understand the motivation and agree with it. But an optional compiler flag would be nice for development, instead of the special syntax that has to be applied per unused identifier. And I just don't get why the compiler has to throw an error about a formatting preference when the builtin formatter already changes it accordingly. Any serious project can just mandate use of the formatter to keep things consistent and be done with it. Instead the github issues have people debate tabs vs spaces because the compiler took a side in order to end the "bikeshed of all bikesheds", ironically contributing to it.