Comment

Comment by Rohansi

I mean, sure, but RAII (in C++, at least) is implemented the same way as this article: with a try...finally block!

RAII doesn't really fit into every language because they don't all have deterministic destructors/finalizers and objects with scoped lifetimes. Sometimes you only have one but not the other and you definitely need both.

parent Rohansi 3 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton