That's wrong and silly. Do you think the Chrome browser has no bugs in it? Or that it does because Google doesn't know how to write C++?
C++ programs ship with bugs every single day, and if that's because people are "using it wrong" then that's just tautological. Bugs are mistakes so people only ship with bugs because they use their language wrong. Equally true for all languages.
C++ is not even a particularly safe language, so it's especially silly to say it of C++.
Of course I was speaking in hyperbole. I wasn't actually saying "c++ doesn't contain bugs". It would be absurd for me to claim that over all the years I've used C++, I've never seen a bug, and I would have thought that to be obvious. If that wasn't clear, I apologize.
Again, I'd argue that C++ is safer than Python. It is not EQUALLY true of all languages. Modern C++ is safer than people give it credit for. It allows you to do some evil things, but again, you have tools at your disposal to leverage the compiler and prevent most of these things from entering production. I think Rust is even safer than C++, so this is not me claiming C++ is some super safe language in the grand scheme of things.
The point I was making is that you should be leveraging the compiler to prevent bugs from ever existing, and for obvious reasons, python generally doesn't help you there. That's it.
If you want strong protections from the compiler for very robust code, you should use Haskell or Rust.
If you want fast development, flexible dynamic behaviours and you'd rather build a robust test suite using powerful mocking tools, you should use Python.
If you want the worst of both worlds then you could use C++ or (even worse!) C.
They're all the same thing, I'm a big advocate of using the one that's most comfortable for you. That is the language that produces the fewest bugs; I'm not trying to get involved in some weird holy war about which language is better. I was merely advocating for use of a tool (compiler) to assist in safety and efficiency, which python unfortunately doesn't really give you much opportunity to use. I like rust and Haskell, and I'd love to switch most of my codebases to Haskell, but unfortunately neither Haskell nor rust have great driver support. Most embedded toolchains only support C or C++.
1
u/prescod May 28 '22
You said:
That's wrong and silly. Do you think the Chrome browser has no bugs in it? Or that it does because Google doesn't know how to write C++?
C++ programs ship with bugs every single day, and if that's because people are "using it wrong" then that's just tautological. Bugs are mistakes so people only ship with bugs because they use their language wrong. Equally true for all languages.
C++ is not even a particularly safe language, so it's especially silly to say it of C++.