Programming means given instructions to a computer so by definition if something goes wrong the programmer is the one that is the one given the wrong instructions. When trying really hard to make something work it can be frustrating at time when the code doesn't do what is expected. All programmers have gone through that until the Aha! moment where you find why is not doing what you are expecting. You celebrate and then move on to the next challenge but sometimes we forget to document and when the challenge presents again deja-vu.
Troubleshooting problems is one of the most valuable skills to be learned. It helps in all aspects of life school, work, business and sometimes at home. However logic might not be the language you are dealing sometimes stating problems logically always help, assessing options (what ifs) and knowing what to do in the mean time (while statements) is invaluable when making decisions under pressure.
Having said that it's human to feel frustration when things are not going the way we want. So I suggest the 3Ps I learn throughout my career that helps me when dealing with a difficult bug when programming, broken system or equipment or just a process that is not effective as per the second law of Thermodynamic or simply when things just go wrong at the same time Murphy's law. Regardless rather than getting frustrated, it's important to look at the problem from different points of view and that is the first P: Perspective.
Perspective allows you to look at a problem from different angles, this is especially important when dealing with bugs in programs. A simple example I dealt recently while working with my father on one of the Robo-Geek projects. The communication between my laptop and our test robot will stop when 2 motors were activated at the time. I reviewed the logic and test that every line was doing was supposed to do by inserting print statements and comments, however after trying a few times, we concluded the logic was functional, so then we move to the next logical step and through induction we check the voltage as we suspected the two motors were drawing too much current. It turned out that the voltage was indeed low which told us that it was time to replace batteries.It sounds simple but we happen to work late, we were a bit cranky and tired. We laughed later but I can see how someone only looking at the program point of view might miss it all together.
The second P is Patience. Yes and lots of it. Most mistakes in programming are made when skipping crucial steps and trying to rush trough coding and keep compiling and running the code until we get it working. It's better to plan the logic and functions. Object oriented programming brings a new level of discipline by having good discussion of classes ahead of the design. This is crucial that test code to ensure proper communication between libraries and that the inner framework is functional. The proceed to develop the test functions discuss inputs and outputs required. Then put everything together, the likelihood it will work are much higher. A good programmer is good at troubleshooting but is even better if they make their program robust so others can follow it and modular so others can use it as well. Programming is a profession and I suggest the discipline is built early on. Making it work is important but being able to reuse the applications we develop is even more valuable. So ensure documentation is clear and take time to comment and have code you will be proud to publish.
The third and last P stands for Persistence. Yes no one learns to program over night. Like no one can speak Russian or Mandarin with one lesson. It takes time and lots of practice to learn how to program. And one thing to bear in mind is that the learning is exponential not linear, meaning it's cumulative and whatever you learn you will continue using later on. Taking projects to completion is key, half way done or kind of working is not a good investment in the future. Accomplishing the creation of an application that can be used by others is what truly rewarding. Take the challenge and don't give up easily. Ask for help, reach out, there are lots of people that has dealt with what you are dealing with and have either written a tutorial or a book on the subject. It's always technically possible, it might require significant time, money and other resources but it always can be done. Now use yours smart to do it at the least cost, in the shortest amount of time and with the minimum drain on resources.
With that I leave you with the 3Ps when troubleshooting. Remember next time you are dealing with that "unsolvable or impossible" problem. I'd love to hear about a recent troubleshooting and how you applied any of the 3Ps in the process. Cheers and happy debugging.
Omar
Troubleshooting problems is one of the most valuable skills to be learned. It helps in all aspects of life school, work, business and sometimes at home. However logic might not be the language you are dealing sometimes stating problems logically always help, assessing options (what ifs) and knowing what to do in the mean time (while statements) is invaluable when making decisions under pressure.
Having said that it's human to feel frustration when things are not going the way we want. So I suggest the 3Ps I learn throughout my career that helps me when dealing with a difficult bug when programming, broken system or equipment or just a process that is not effective as per the second law of Thermodynamic or simply when things just go wrong at the same time Murphy's law. Regardless rather than getting frustrated, it's important to look at the problem from different points of view and that is the first P: Perspective.
Perspective allows you to look at a problem from different angles, this is especially important when dealing with bugs in programs. A simple example I dealt recently while working with my father on one of the Robo-Geek projects. The communication between my laptop and our test robot will stop when 2 motors were activated at the time. I reviewed the logic and test that every line was doing was supposed to do by inserting print statements and comments, however after trying a few times, we concluded the logic was functional, so then we move to the next logical step and through induction we check the voltage as we suspected the two motors were drawing too much current. It turned out that the voltage was indeed low which told us that it was time to replace batteries.It sounds simple but we happen to work late, we were a bit cranky and tired. We laughed later but I can see how someone only looking at the program point of view might miss it all together.
The second P is Patience. Yes and lots of it. Most mistakes in programming are made when skipping crucial steps and trying to rush trough coding and keep compiling and running the code until we get it working. It's better to plan the logic and functions. Object oriented programming brings a new level of discipline by having good discussion of classes ahead of the design. This is crucial that test code to ensure proper communication between libraries and that the inner framework is functional. The proceed to develop the test functions discuss inputs and outputs required. Then put everything together, the likelihood it will work are much higher. A good programmer is good at troubleshooting but is even better if they make their program robust so others can follow it and modular so others can use it as well. Programming is a profession and I suggest the discipline is built early on. Making it work is important but being able to reuse the applications we develop is even more valuable. So ensure documentation is clear and take time to comment and have code you will be proud to publish.
The third and last P stands for Persistence. Yes no one learns to program over night. Like no one can speak Russian or Mandarin with one lesson. It takes time and lots of practice to learn how to program. And one thing to bear in mind is that the learning is exponential not linear, meaning it's cumulative and whatever you learn you will continue using later on. Taking projects to completion is key, half way done or kind of working is not a good investment in the future. Accomplishing the creation of an application that can be used by others is what truly rewarding. Take the challenge and don't give up easily. Ask for help, reach out, there are lots of people that has dealt with what you are dealing with and have either written a tutorial or a book on the subject. It's always technically possible, it might require significant time, money and other resources but it always can be done. Now use yours smart to do it at the least cost, in the shortest amount of time and with the minimum drain on resources.
With that I leave you with the 3Ps when troubleshooting. Remember next time you are dealing with that "unsolvable or impossible" problem. I'd love to hear about a recent troubleshooting and how you applied any of the 3Ps in the process. Cheers and happy debugging.
Omar