C++ vs C Debugging: How Hard Is It?

Click For Summary

Discussion Overview

The discussion centers on the comparative difficulty of debugging in C versus C++, exploring various perspectives on the implications of language features, project complexity, and debugging tools. It includes considerations of both theoretical and practical aspects of debugging in these programming languages.

Discussion Character

  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant questions the difficulty of debugging in C++ compared to C, referencing a metaphor about the potential severity of errors in each language.
  • Another participant argues that C++ can be easier to debug due to its object-oriented nature, which encourages better code structure.
  • A different viewpoint suggests that while C++ may prevent some errors, it can also lead to more complex debugging scenarios due to larger project sizes typically associated with C++.
  • One participant emphasizes the importance of the features available in source level debuggers, suggesting that these tools can significantly aid the debugging process regardless of the language used.

Areas of Agreement / Disagreement

Participants express differing opinions on the relative difficulty of debugging in C versus C++, with no clear consensus reached. Some believe C++ is easier to debug, while others highlight the complexities that can arise in larger projects.

Contextual Notes

Participants note that the complexity of debugging may depend on various factors, including the structure of the code, the size of the project, and the capabilities of debugging tools. There are also references to the variability of code behavior across different compilers.

Who May Find This Useful

This discussion may be of interest to software developers, programmers considering language choices for projects, and those interested in debugging practices in C and C++.

Domenico94
Messages
130
Reaction score
6
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.)
 
Technology news on Phys.org
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!)
 
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).
 
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
69
Views
11K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
6
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 133 ·
5
Replies
133
Views
13K
  • · Replies 122 ·
5
Replies
122
Views
18K