4 ms·
It was the intent of that line and I totally agree with your comment. C is definitely not the right tool for every job. And in fact, I don't write that much C
by GuB-42 6y ago
It was the intent of that line and I totally agree with your comment.
C is definitely not the right tool for every job. And in fact, I don't write that much C for that reason, the cognitive load of tracking every bit of memory is high and not always justified.
I wouldn't put C and "modern" C++ in the same class though. They are actually very different from a memory management perspective.
You can write C++ like you write C, there are plenty of valid use cases for that. However, the "standard" way of doing C++ now implies things like containers, RAII and smart pointers. It means objects get allocated and de-allocated automatically, dangling pointers and buffer overflows are less likely, but it has a cost in terms of performance and control. Another tool for another job.
- harry8 6y agoYeah totally, completely agree. One of the things C and Modern idiomatic C++ (using C++11 on) have in common is some part of the culture surrounding them having a tolerance for, if not liking of, macho arrogance. "If you got burned it's purely because you're stupid and lazy which I am not, ha ha." This kind of vibe. Not everywhere by any means, but it exists and it's destructive to sensible analysis and the writing of good quality software, while alienating some talent from the pool of potential colleagues. I strongly dislike it.