Comment

Comment by GuB-42

To me, that's not RAII, it is static analysis, useful, but different.

To me, the name "Resource Acquisition Is Initialization" implies that doing one means the other one is done implicitly. Now, in the end of the day, the result is machine language, with proper discipline you can follow the RAII principles in any languages, including assembly, but I have always understood RAII as being it done implicitly.

Also we can argue that Zig supports a weak form of RAII through the use of "defer", there are some nuances here.

parent GuB-42 3 days ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton