News for hackers. Stuff that matters.
Re:Getting started with C by qsort on Thursday December 17, 2020 @05:48AM (#25454397)
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.

Re:Getting started with C by asveikau on Thursday December 17, 2020 @12:08PM (#25457510)
I 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.