Ravenshade wrote:
TheIdeasMan... using Code::Blocks performs debugging in the exact same manner. Build...see errors in terminal output...solve errors...rebuild...solve more errors. Cycle repeats until the damn thing builds. |
I thought so, but credit to
Disch for wisely mentioning it in the first place.
Building is not debugging. Building is compiling & linking.
Debugging is fixing runtime errors, of which there are different sorts. The most common one for newbies is a segfault, which means the bad access of memory - like going past the end of an array.
The more tricky sort, are logical errors, which is where the program compiles, but produces the wrong answer because the logic is wrong. For example you want your program to multiply numbers by 10, and wonder why it doesn't. The answer is you had
* 1.0
and not
* 10.0
.
One can use a debugging program to keep an eye on the value of variables and see where they go wrong & deduce why. This is much easier than outputting values with code - that is what I used to do in 1987 & is definitely the hard way of doing things. A dubugger can have breakpoints & allows results of expression to be done on the fly. You can step over or into functions & loops.
What is happening here, highlights the problems of learning the way you are. There are concepts that you are not even aware of, or at least have misguided idea of what the concept is. The same thing (user not aware of concepts) can happen with someone using an IDE, but difference is that the IDE will do a lot of stuff automatically or implicitly. For example, an IDE probably has a Debug menu, which you would notice & might have a go with, just to see what it does - now you have discovered debugging. In the shell, you have no idea a debugging program even exists, and probably won't do until someone tells you about it, or you read about it somewhere.