Troubleshooting tip #5 -look for alternatives and workarounds
Couple of developers came to me yesterday, that they were unable to solve a problem. They have been cracking their head for more than a day with no feasible solution. I asked them to go through the program and asked them to explain me step by step what the code did and what was expected. It turns out that one api did not support a feature that another api provided. The developers searched in the net, a site provided an unguaranteed plugin, that altered the core api code, and few sites took right in telling them to change the requirement.
As I went through the requirement and the code that they had written, it struck my mind the solution is round the corner and was a real alternative to the actual solution of worrying about inconsistency between the api’s. Ofcourse the solution was not very straightforward and deviated from the traditional approach, but at the same time it was an excellent alternative with no side effects and/or no change in the expected output. The point here is api inconsistencies and incompatibilities are certain to happen, particularly when you are working with more than one technology and trying to make them work together. Rather than trying to fix the api look around and look for alternatives and workarounds. You will find that its not that bad when you can accomplish what you want with simple workarounds. Mark a comment in your code about the alternative. And as a homework you should always keep watching the api patches and new versions and whenever the api inconsistencies are fixed you should set right your code with the straightforward solution.










