When I first started writing C++, I found myself making a lot of rookie mistakes, like returning a dangling reference to a local variable. These days though, I only make the kinds of mistakes that even trip up seasoned C++ experts, like returning a dangling reference to a local variable
@slava When I was writing C++ code in the 1990s, I think I would have predicted that, by 2026, there’d be readily available code inspection tools that would have eliminated that possibility from ever happening again. Instead we have “AI” that produces garbage at an astronomical environmental and societal cost. That’s just great.

@Kimota94 @slava There are some C++ static analyzers that can help (and IIRC, generally do catch this particular problem fairly consistently).

But, it turns out at retrofitting static checks onto an existing language is much harder (and more heuristic-driven) than making the static checks part of your language.

Rust and Idris compilers can prevent whole classes of bugs, at least until you you _ask_ to be exposed to them. (`unsafe`, `believe_me`, `panic`, `idris_crash`).

But also, trying to move an large existing code base over to a new language is almost always long and painful and very hard to make "value-driven" or reflected in your KPI.