Friday, February 10, 2012

Simple Steps to Problem Solving

For the last couple months, every time I find myself with some downtime I try and answer questions on stackoverflow.com.  I see many questions regarding error logs, and built in functions.  Most of these can be solved by developing a problem solving approach.  There are a couple aspects to this approach.

1)  Read the documentation
99% of the time the best source of information about a library, built in extension, code, etc is the documentation that comes with the code.  I have only very very rarely run into code whose documentation was very poor.  In my experiences I usually skim over documentation, thinking that I can just look at the code samples.  I end up being wrong most of the time.  I can't even remember how many times, I've been stumped and the answers to my questions are in the basic documentation.  Reading every word of the relevant documentation is never a waste of time, after all it's the information the developers believe is necessary to user their code.
 
2) Error logs are not lying
When errors happen they are logged somewhere.  The tricky part then becomes finding out where the logs are.  The other day I was setting up amazon ec2 instance.  I forgot that I had whitelisted the users that were allowed to connect through ssh.   I kept getting a publickey ssh error when trying to connect from my remote machine.  The trick to solving this was to find out where the error log was located ( on the actual ec2 instance) and once I found that out, it clearly indicated that my account was not allowed to connect.  There are so many questions on so involving 500 errors, or php errors.  Knowing where the error logs are and how to read them are an indispensable part of problem solving.
Exceptions are not lying either
In addition to the recommendation above. Errors do not lie.  When the interpreter finds an error on line x.  There is usually an error on line x.  Copying the error and pasting it into google will usually quickly yield a result.

3) Learn to google
Effective google queries is a skill. I wish I had some advice for how to do it.  I think the problem is, the internet has such an abundance of information even a poor googler will eventually find what they are looking for, giving them negative reinforcement.  Learning to effectively google for an answer is a crucial skill.


4) Learn to rely on yourself
Developing good trouble shooting and problem solving skills takes practice.  At first it will be easier to ask other people whenever a roadblock is run into.  But breaking away from this habit will be best in the long run.

No comments:

Post a Comment