News for hackers. Stuff that matters.
Re:Zig; what I think after months of using it by lolinder on Tuesday February 04, 2025 @11:35PM (#42943848)
> Often, the bug is caused by an accidental use of := instead of =.

This is a distinctly Go problem, not a problem with shadowing as a concept. In Rust you'd have to accidentally add a whole `let` keyword, which is a lot harder to do or to miss when you're scanning through a block.

There are lots of good explanations in this subthread for why shadowing as a concept is great. It sounds like Go's syntax choices make it bad there.

Re:Zig; what I think after months of using it by lnenad on Tuesday February 04, 2025 @11:43PM (#42943907)
> There are lots of good explanations in this subthread for why shadowing as a concept is great

Not really. All of them boil down to ergonomics, when in reality it doesn't bring a lot of benefit other than people hating on more descriptive variable names (which is fair).

Re:Zig; what I think after months of using it by lolinder on Wednesday February 05, 2025 @09:12AM (#42948708)
You're saying ergonomics aren't a good explanation? The entire point of a programming language over writing machine code boils down to ergonomics! You've got to do better than "it's just ergonomics" when your argument for a language to ban shadowing is also "just ergonomics".

The debate here is about which one truly has better ergonomics!