Time has proven again and again that humans are really bad at memory management and having raw access to memory is something that needs to be justified on a case by case basis.
Time has proven again and again that humans are really bad at memory management and having raw access to memory is something that needs to be justified on a case by case basis.
Well until AI write garbage collectors I'm not sure I see how your comment doesn't also apply to them. And lots of great software manages memory quite fine, like that browser you used to write your comment and the operating system it runs on, so not sure the use of "proven" is appropriate in your comment.
https://developer.mozilla.org/en-US/docs/Mozilla/Performance
And are making Servo in Rust, which uses compiler dataflows form memory management.
Apple has added ARC to Objective-C and Swift.
Microsoft uses GC in .NET, ARC in C++/CX.
Modern C++ favors RC.
They all seem to think manual memory management is to be avoided.
However it does place a bit of cognitive burden, but last version already improved it.
Does it? I was under the impression that the order of preference (from most preferred to least) is something like:
- plain values (i.e. no pointers)
- references
- unique_ptr
- shared_ptr
- raw pointersYes.
> the others are the main/preferred strategy in those languages/libraries.
While true, manual memory management is still possible, but should be left for the 1% cases that really benefit from it.
Most applications are _not_ games or web browsers, but enterprise-y CRUD applications.
I'm fine with having the ability to turn that off for specific things, but it should be made as inconvenient as possible to avoid the "Can't have GC pauses in my todo list" usecase.
Which bit of the browser are you talking about? Garbage collection is used extensively during the execution of JavaScript in a lot of browsers. For example, Chrome [1].
[1] https://developer.chrome.com/devtools/docs/javascript-memory...