by Merad · 3y ago · 0 comments
I would say that's debatable. RAII definitely dates back to the earliest days of C++, but you don't have to know it in order to use the language. Even today there are many professional C++ devs who've never really learned RAII because they write C with classes style code. I first started learning C++ about 20 years ago and IIRC at the time usage of RAII was still in the minority but there was real momentum towards it being considered the "right" way to do C++.
I'm not claiming that it's good C++ code (or good code by any measure) but I imagine those "C with classes" devs would do something like:
my_string* s = new my_string();
s->initialize("hello world");
// ...
s->destroy();
delete s;