Hacker News new | ask | show | jobs
by lionkor 266 days ago
Slightly off-topic, but:

The fact that go "lifts" the deferred statement out of the block is just another reason in the long list of reasons that go shouldn't exist.

Not only is there no protection against data-races (in a language all about multithreading), basically no static checking for safety, allocation and initialization is easy to mess up, but also defer just doesn't work as it does in C++, Rust, Zig, and any other language that implements similar semantics.

What a joke.

1 comments

One of those languages being D, which invented it (well, Andrei Alexandrescu did) under the name `scope(exit)` (there's also `scope(failure)` which is like Zig's `errdefer` and `scope(success)` which no other language has AFAIK).