How to Think Like a Hacker, Even If You Can’t Code
2. Break the problem down into components (also necessary for finding the brute force solution). What specific set of steps is required to comprehensively solve the problem? Solving a simplified example can be a useful exercise at this point.
4. Recurse these initial steps to the subproblems. Apply steps 1-3 to the steps/subproblems identified in step 3.
5. Implement each subproblem solution. Along the way, it’s important you design your process for repeatability. In a coding context, that means using standard best practices like defining terms (naming variables in a way that makes sense to another reader), adding explanatory notes (commenting), and formatting properly (spacing). More on that below.
6. Test each subproblem solution. Be sure to check boundary cases. Separating code into modules and rigorously testing each allows the programmer to localize errors so that instead of having to search the entire program, he or she need only search one small section. This general principle applies to pretty much any complex system.
7. Critically assess inefficiencies and iteratively improve solutions. Programming often involves returning to one’s work to make further optimizations or adjustments—ie, never being satisfied. , for example, the name of one of the most famous and elegant algorithms in computer science, was the product of decades of iterative improvements by multiple academics. The Lean Startup movement draws from this same philosophy.
8. Once all subproblem solutions have been implemented, tested, and refined, do the same for the overall solution.