C/C++ Debugging – Everything That Many People Say..

As a lot of criteria would vary PHP from a skilled and skillful one, probably the most important criteria is the opportunity to debug their own code. A newbie programmer would write his code snippet, leave parts “for later”, without spotting the truth that they left a lot of bugs, compile and run the code, and then see that his code doesn’t work, for some weird reason. Well, beginning from the compilation part to noticing that things are screwed up is a part of programming itself, and bugs on the first compilation doesn’t make you a bad programmer.

However the difference between bad/inexperienced programmers and skillful/experienced programmers starts here. A lot of the “programmers” out there would take into consideration their problem for (maximum) 5-10 minutes, go to StackOverflow/FXP/Their senior programmer friend, and post something similar to that:

Hello. My code doesn’t work. Here it is: some code Please fix it in my opinion. In the event you can’t spot at least 3 wrong reasons for this post, well, you should start considering a brand new career. This post shows a typical “I have never really tried to solve this problem, solve it to me” method of thinking. It is possible to immediately see that:

“My code doesn’t work” – Well, OK there. If it worked, you wouldn’t have posted it here, right? What really doesn’t work? Do you expect your friends to know your code on their own? “Please correct it for me” – This shows zero will to truly solve the problem. You must realize that so long as the issue is yours, you are the person who should solve it. Not to mention, I must point out that asking others/your smarter/more skillful friend should be the LAST thing you do. First, you try and solve the problem by yourself.

So we saw what a newcomer would do. Now, how could Fantasy fiction handle this annoying but frequent situation? First, before we could solve the bug, we have to spot the bug. If the exception is raised, well, it is simple to tell the location of the bug. Otherwise (talking about logical bugs):

If you deal with a great IDE, like Visual Studio, Eclipse, PyCharm, etc., you can run the program step by step, examine your variables’ content, and see the line/function that fails to operate properly. If not, you can print checkpoints to see where the code reaches before it breaks, and you can print your variables’ values to find out what goes wrong. Of course, the initial approach is preferred as it’s easier and more convenient way of working.

After spotting where bug occurs, you should begin searching for why it does. Usually, you’ll find a problematic value of among the variables on the line of the bug (can be a never raised flag, a never incrementing counter, a null or falsy value, etc.). If the thing is not variable related, it might be an uninitialized object, unopened connection, or any other arlkkg you could forget to perform – import a library, reset a link, etc.

Now, what’s left is always to trace the problematic variable’s value, see where it’s assigned wrongly, and try to remedy it (or at best discover the cause for the problematic assignment). In the event you don’t know why a particular function fails to work as you’d expect it to, what a specific class does, or just what a weird error means, be aware that GOOGLE is your best friend. Googling your problem fails to make you a poor programmer. It actually makes you an improved one – a programmer that will find his needed information by himself.

Now, you need to remember. Debugging is not a science, it’s a skill. It doesn’t possess a clear step-by-step solution. Always start debugging “open minded” – bugs occur due to strange reasons, in unexpected places. Also, remember that there is certainly nothing wrong in asking for Medical – never feel embarrassed to ask your mates/a programming forum/StackOverflow for answers. But additionally keep in mind that other individuals may well be more open to help in the event you demonstrate to them which you a minimum of tried to deal with your problems. Don’t allow them to believe that they do your projects.

And finally, a great programmer that utilizes the methods described here, Google and friends in a wise and balanced way would find and fix his problems thousands of times faster than a programmer that each and every bug he sees equals to another telephone call his experienced friend receives. So in a single sentence: Do your very best to research it utilizing the tools you might have, and ask others only when really needed.

Leave a Reply

Your email address will not be published. Required fields are marked *