3 ms·
Because smart pointers are still pointers under the hood. You're forgetting the time before you know what pointers were - people coming from higher level langua
by junon 5y ago
Because smart pointers are still pointers under the hood. You're forgetting the time before you know what pointers were - people coming from higher level languages don't immediately grok the concept. By teaching them automatic memory management patterns like we use in C++ without teaching them why you need such things, they'll never fully understand the code they're writing.
It's like the "I know React but not JavaScript" crowd all over again.
- pjmlp 5y agoIf you think RAII is about smart pointers, you really don't understand it. RAII is about resource management, regardless of where those resources live on. Heap allocated, OS handles, indexes on a fixed sized buffer, network sockets, ...
- junon 5y agoYes, I'm aware, thanks. Lifetimes, ownership, etc. are all overlaps of RAII and associated concepts. Again, what did being pedantic prove here? You clearly understood what I meant.