Think like a programmer - 401-advanced-javascript-billybunn/seattle-javascript-401d29 GitHub Wiki

A summary of How to think like a programmer — lessons in problem solving by Richard Reis

Purpose

Being a programmer is less about technical skills in a syntax for some computer language and more about solving problems efficiently. Essentially, solving a problem "like a programmer" means a) having a framework for solving problems, and b) practicing that framework.

Summary

Key steps in problem-solving:

  1. Understand the problem fully, know what is being asked, know what the end-goal is.
  2. Plan the exact steps to solve the problem. Use pseudo code, comments, diagrams, etc.
  3. Divide the problem into smaller tasks. Do not try to tackle it all at once. Connect a series of sub-solutions to solve it.
  4. If you get stuck,
    • Debug. Go step-by-step through your solution and look for any errors.
    • Reassess. Take a step back and look at it from another perspective. Consider starting from scratch.

Practice, practice, practice. If you want to be a good problem solver, solve lots of problems. Practice using your problem-solving framework often.