But the distinction between bad/inexperienced programmers and skillful/experienced programmers starts here. Most of the “programmers” available would consider their problem for (maximum) 5-ten minutes, go to StackOverflow/FXP/Their senior programmer friend, and post something such as that:
Hello. My code doesn’t work. Here it is: some code Please fix it to me. Should you can’t spot a minimum of 3 wrong reasons for this post, well, you can start considering a whole new career. This post shows a typical “I actually have never really made an effort to solve this issue, solve it for me” means of thinking. You are able to immediately notice that:
“My code doesn’t work” – Well, OK there. If this worked, you wouldn’t have posted it here, right? What really doesn’t work? Would you expect your friends to understand your code independently? “Please remedy it for me” – This shows zero will to truly solve the situation. You must realize that as long as the issue is yours, you are the person who should solve it. And naturally, I must mention that asking others/your smarter/more skillful friend should be the Very last thing one does. First, you try and solve the issue alone.
So that we saw exactly what a newcomer would do. Now, how could Fantasy fiction handle this annoying but frequent situation? First, before we can solve the bug, we have to spot the bug. If an exception is raised, well, you can easily tell the position of the bug. Otherwise (referring to logical bugs):
If you work with an excellent IDE, like Visual Studio, Eclipse, PyCharm, etc., it is possible to run this system step-by-step, check your variables’ content, and spot the line/function that fails to run properly. Otherwise, it is possible to print checkpoints to view where code reaches before it breaks, and you can print your variables’ values to see what goes completely wrong. Of course, the initial approach is preferred as it’s easier and much more convenient method of working.
After spotting in which the bug occurs, you should start looking for why it does. Usually, you’ll locate a problematic value of one of the variables on the line of the bug (can be quite a never raised flag, a never incrementing counter, a null or falsy value, etc.). If the issue is not variable related, it may be an uninitialized object, unopened connection, or some other arlkkg you may forget to do – import a library, reset a link, etc.
Now, what’s left would be to trace the problematic variable’s value, see where it’s assigned wrongly, and try to fix it (or at a minimum get the cause towards the problematic assignment). In the event you don’t know why a particular function does not work as you’d expect it to, exactly what a specific class does, or what a weird error means, remember that GOOGLE is your best friend. Googling your issue does not allow you to an unsatisfactory programmer. It actually makes you a much better one – a programmer that will find his needed information by himself.
Now, you should remember. Debugging will not be a science, it’s an art. It doesn’t use a clear step-by-step solution. Begin debugging “open minded” – bugs occur because of strange reasons, in unexpected places. Also, remember that there is no problem in requesting Medical – never feel embarrassed to ask your friends/a programming forum/StackOverflow for answers. But also keep in mind that others may well be more ready to accept help should you show them which you at the very least tried to handle your problems. Don’t permit them to believe that they are doing your job.
And finally, a good programmer which uses the techniques described here, Google and friends in a wise and balanced way would find and correct his problems a thousand times faster than a programmer that every bug he sees equals to another one call his experienced friend receives. So in one sentence: Do the best to analyze it using the tools you might have, and get others only if really needed.