2 ms·
Completely agree, that was part of the point I was making, for example, I doubt I would ever have understood RAII had I never seen malloc. Parent was suggestin
by qsort 6y ago
Completely agree, that was part of the point I was making, for example, I doubt I would ever have understood RAII had I never seen malloc.
Parent was suggesting they are already a programmer, so I assumed they already had at least a grasp of how pointers and manual memory management work. If one happens to lack such knowledge, I agree learning C is an excellent first step.
- asveikau 6y agoI understood malloc very well long before RAII made sense to me. I think what made RAII seem like a good idea was seeing a large C code base at a major company which had a consistent approach to cleanup and error handling. It's very possible to write good code that way, but it takes manual effort, discipline, consistency. At that point I understood that RAII was about letting the compiler handle what I was already doing in C.