3 ms·
Biased and unsubstantiated article, written by "VP of Community at the Zig Software Foundation". Lack of RAII in Zig is one of the reason why I refuse to write
by SuperV1234 2y ago
Biased and unsubstantiated article, written by "VP of Community at the Zig Software Foundation".
Lack of RAII in Zig is one of the reason why I refuse to write any software in it -- it's such a backwards design decision that throws decades of programming language safety in the bin. `defer` can be forgotten and is not enforced at compile-time, it's a terrible solution. Also, `defer` can be implemented in terms of RAII if needed.
Yes, yes... arena allocation can be faster than deallocating every object one by one, Casey is a convincing/charismatic individual with extreme and biased opinions and an extremely narrow programming domain, can RAII can be misused and cause slowdowns.
Every programmer that understands RAII knows these things. Guess what -- when provably better, you can use RAII for the whole arena and not each individual component. Also -- data oriented design is not inherently incompatible with abstractions and RAII.
I'm tired of seeing all these misconceptions, when -- TBH -- it's mostly a skill issue.