Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# C++ and c debugging?

  1. Jul 18, 2015 #1
    How hard is c++ debugging compared to c?
    What do you think o f the sentence:
    "It s easier to shoot your foot in c. In c++ it s harder, but when you do, you blow away your whole leg"?
    Is it really hard( considering the fact code isn t "context free" and it may vary from compiler to compiler, it s more complex, ecc.)
  2. jcsd
  3. Jul 18, 2015 #2
    Personally I think C++ is easier to debug when you get used to it..
    Because being object orientated, the developer has to structure the code in some sort of orderly manner.
    C on the other hand allows for code spaghetti which can be very hard to comprehend at all if it's not well commented.
    (Even by the original author!)
  4. Jul 18, 2015 #3
    It's harder to screw up in C++, but I think it's also easier to debug C++. Since in C you need to get into many small details, it's easier to miss a bug when coding, and harder to find one after the code is written. That quote may come from the fact that C++ usually involves much bigger projects than C ones (games and many Windows apps are written in C++), so it's logic that it's harder to debug those bigger programs (unless we're speaking about operative systems and drivers coding, that are usually coded in C/Assembly).
  5. Jul 19, 2015 #4


    User Avatar
    Homework Helper

    I think the features in a source level debugger are more important than the differences between C and C++. With a good source level debugger, you can inspect variables and/or objects to view their content, while stepping through a program. Break point and trace point features are also nice to have.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook