2 ms·
Usually programmers don't care about the exact order that things are freed in. That's the whole reason why GC's have been so successful in programming languages
by pcwalton 10y ago
Usually programmers don't care about the exact order that things are freed in. That's the whole reason why GC's have been so successful in programming languages (not to mention things like ARC, which are still deterministic but obscure).
I get that occasionally it's important to know the exact order, and this is where tighter rules and tooling can help. Rust wasn't designed to be an "everything is as explicit as possible" language. (Neither is C, for that matter, ever since compilers stopped paying attention to the "register" keyword…)
- barrkel 10y agoGC lets you write functions that return heap allocated values without worrying about who's responsible for freeing the result. That in turn leads to functional code over procedural, which in turn leads to simpler and easier understood code. That is, it's less about order and more about bookkeeping. The ergonomics directly affect code quality.