Solving programming bugs
Working alone
- Google is your friend - google "the 1223 error message text"
- Read Stack Overflow
- Explain to a rubber duck
- Read the source code ( of imported module, this is a great way to learn new stuff )
- Read the documentation ( RTFM )
- Read the test cases ( if they exist )
- Check your mental model by changing anything to see if you get the expected result
- Step through the code in the debugger
- Insert print lines to follow what happens
- Decompile the code
- Divide and conquer - Take the problem apart and solve the small issues
- Write small tests for the problematic module
- Write a very small program that reproduces the problem
- If a used module is not documented/maintained throw it away
- Use another lib or write your own
- Search relevant research when you have a bit of knowledge
- Visit conferences on the subject
Asking questions
- Prepare question for others
- “What did you want to happen?”
- “What actually happened? (Include any error details)”
- “Paste the shortest block of code that reproduces the problem. (Well formatted!)”
- “Describe what you’ve tried so far (including searches, etc.)”
- Ask question on Stack Overflow ( never mind the Stack Elitism jerks )
- Ask in the github forum for help
- Ask questions on Google business forums for Google maps
- Ask on Facebook in Kodapor ( read the rules first )
- Send an email to others that use this code and seems to have solved it
- Send an email message to the author of the code
Involving others
- Send a slack message to a colleague for help
- Ask for help on the Stand Up Meeting
- Ask a senior person ( Read though rules for not destroying someone else productivity )
- Walk through the problem with a colleague
- Use a white board to describe the flow
- Describe your mental model to a colleague
- Know all admins and functionality owners so questions can be answered quickly
- Pair programming
- Mob programming
Take time of - Mental processes
- Get some coffee
- Take a walk
- Take a shower
- Sleep on it
- Let it rest for a while ( day, week, month )
Giving up
- Choose another solution
- Assign the problem to another
- Bring in another member into the team
- Hire a consultant
- Pay the open source code developer of a problematic module to fix it
New code from start
- Write the comments for all the small parts of the total solution first, before coding.
- Write the documentation first, then the tests and finally the code
- Use a pen and paper to describe the flow before coding
What destroys productivity
- Bugs
- Meetings
- Interruptions ( by the boss or colleagues asking questions or telling jokes )
- Context switching
- Hard to read code
- Que time waiting for blocking answers from other people
How would you like to be treated by your co-workers? Kindness, considerations and respect. This needs to be learnt.