How to avoid it? Think. Be careful. Write good test suites. Run them a lot. It really isn't so hard.
How to avoid it? Think. Be careful. Write good test suites. Run them a lot. It really isn't so hard.
This mindset lead to countless security problems and other bugs in all kinds of software. Even now we still find exploits in sudo and openSSL. And the problem wasn't developers leaning back and saying "today I'm going to program carelessly and do a bad job because why the hell not".
GC was also originally developed for LISP; I'm not sure it's even conceptually possible to have a manually-manged lisp, although I think there's a refcount implementation somewhere.
Many tend to mix the choice of implementation language, with other criteria that the authors cared more about.
That is after all how Lisp workstations like Interlisp-D or Lisp Machines were implemented, and those features carried on into Common Lisp.
Concurrency is a much harder problem and something we deal with more often. I would consider memory management close to not a concern.
Absolutely. The longest lasting bug I've ever had was in some multi-threaded code in a trading server (and nothing to do with memory - shared resources getting corrupted). When I tracked it down (after about 6 months!) I repeatedly banged my head on my desk, yelling "You idiot, you idiot, you idiot!" - referring to me.
Compared to stuff like this memory leaks are really easy to test for, detect, and fix. Anyone can write a test harness to see if there is a leak.
Could it be that you never shed the bias from your young 80s BASIC experience, despite the world around you changing?
This doesn't align with the continuing serious security problems associated with memory-management bugs.
> The Chromium project finds that around 70% of our serious security bugs are memory safety problems.
https://www.chromium.org/Home/chromium-security/memory-safet...