| ▲ | vlovich123 4 hours ago | ||||||||||||||||
> A footgun is code that was written in a naive way, looks correct, submitted, and you find out after submitting it that it was erroneous. You’re contradicting yourself a bit here I think. Erroneous code generally won’t compile whereas in Zig it will happily do so. Also, Zig has plenty of foot guns (eg forgetting to call defer on a deinit but even misusing noalias or having an out of bounds result in memory corruption). IMHO the zig footgun story with respect to UB behavior is largely unchanged relative to C/C++. It’s mildly better but it’s closer to C/C++ than being a safe language and UB is a huge ass footgun in any moderate complexity codebase. | |||||||||||||||||
| ▲ | davemp 2 hours ago | parent [-] | ||||||||||||||||
> IMHO the zig footgun story with respect to UB behavior is largely unchanged relative to C/C++ The only major UB from C that zig doesn’t address is use after free afaik. How is that largely unchanged??? Just having an actual strong type system w/o the “billion dollar mistake” is a large change. | |||||||||||||||||
| |||||||||||||||||