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

*smug rustacean noises*

@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.

@slava

Impressive, very professesque

@slava It’s just a way of passing a value into the next function call and putting in a very specific place. 😝
@slava Yeah, but now you use templates for it.

@slava I think that's one of the joys of using a GC'd language, is not having to manually track all the possible (de)allocation policies when trying to design an API for others to implement.

At least with Rust (which I probably should use more), the compiler tracks that stuff.

@slava I circled all that apply
@slava yep, C programming without Valgrind (or equiv) is asking for trouble