9 ms·
I mean both, though OP addressed C++. And you've proved my point. Proper use of carefully-written classes will reduce the risk of a buffer overflow -- but you
by jacques_chester 15y ago
I mean both, though OP addressed C++. And you've proved my point.
Proper use of carefully-written classes will reduce the risk of a buffer overflow -- but you will need to exercise additional vigilance ("Make sure you use STL! Why isn't this code using STL?" etc), over and above addressing the problem, to ensure string safeness is assured.
That's a dead loss that programmers in memory-safe languages simply don't have to pay for the same level of confidence.
- daemin 15y agoI consider the STL to be (essentially) part of the language, hence to program without it, isn't really programming C++ anymore. This is especially true since the introduction of C++11, where the STL enables many language features. Essentially a string is std::string, a resiable buffer is std::vector<unsigned char>, and for a string or a resiable (or unknown size) buffer to be anything else you need to provide a very good reason. I would also be careful with Ruby since a lot of (performance specific) gems and plugins for Rails are written in C, and hence potentially suffer the same problems that one is trying to avoid by using Ruby. Or at least you end up in the same boat if you were using C or C++ to begin with.