Hey mates, I need help with debugging on compiled languages. I mean, I have kinda of a discipline on Python to check if the error is syntatical, semantics or logical and I use the interpreter a lot. And then I started C++ programming and I feel a bit lost on how should I take debugging. It's not as fast as testing things on the interpreter and a lot of different stuff going on. What kind of method do you guys use for compiled languages? A bit of a verbose question, but I hope it is understandable. Thanks in advance :-)
(sorry for messy English also >_<)
When you're starting out, use debug print statements, just like in python. That will probably get you through most problems. If you get into much larger, more complex programs, you'll need an interactive debugger. But that's a huge topic to cover here. But, depending on what environment (IDE, command line, etc.) you use to develop, it will have either good or bad support for a debugger. For now just use printf or cout.
There were several folks in this group that were chatting about this class: http://cs50.tv/2009/fall/#l=lectures&r=about&v=lectures/0/week0w It includes C++. I haven't seen those people around this group for a while, so they may be taking that class now. I don't know if there's a study group for that class, but it stands to reason. I would guess that it would give you some excellent pointers about compilers and debugging.
Thanks both of you :-). I will definitely check that course and try to tackle the errors by breaking the code with test code and print statements. Thanks again.
Join our real-time social learning platform and learn together with your friends!