3 ms·
> I cannot consistently write safe C/C++ code. There's a pretty big ecosystem of tools and techniques beyond just the compiler for writing safe code. Unfortuna
by OnlyOneCannolo 6y ago
> I cannot consistently write safe C/C++ code.
There's a pretty big ecosystem of tools and techniques beyond just the compiler for writing safe code. Unfortunately, they all have usability issues, so the burden of writing safe programs often falls almost entirely on the individual.
- lasagnaphil 6y agoValgrind helps a lot though, it usually solves my memory errors. (If that doesn't do it, then it's either just a logic bug, or you have a really strange bug in the first place!) The main issue people have with it is that its terminal interface is almost always unusable (you get thousands of lines of gibberish text), and there aren't many good Valgrind GUI frontends available. Thankfully CLion has an integrated valgrind inspector that really helps a lot.
- OnlyOneCannolo 6y agoValgrind is good but it's a dynamic tool, so it won't catch anything you don't exercise. There are better options, but there are usually some extra barriers to using them. By usability I also meant getting it to work for your setup and learning how to use it.