Comment by ddtaylor
18 days ago
I need RAII and refuse to debug ugly macros as a workaround. The STL isn't perfect but it's a good guiding principle.
18 days ago
I need RAII and refuse to debug ugly macros as a workaround. The STL isn't perfect but it's a good guiding principle.
Yes, having built-in generic containers and algorithms is the part that keeps me favoring C++. Bespoke versions of these can always be written in C (and work fine) but C++ makes it much easier and saves time. Lambdas and function objects are also useful.
You should try writing something serious in C just for the hell of it. And without RAII-like macros. Write all your allocs and frees.
I very much have. I specifically like to craft ISAs for genetic algorithms over the last two decades. It's not work I publish because I never feel like it matters, although I regret that often. I very much enjoy writing C for this purpose in many ways and I actually enjoy some of the allowances that fit very well to writing an ISA where every bit of the instruction must map to valid behavior and nothing can be an invalid instruction.
It's an ongoing struggle!