- Jumping into a problem without much thinking before hand is not the best way to solve a task, and while it seems like spending time on a task before even coding seems like a waste of time, it's actually quite the opposite
- By following a structured framework for solving problems, we get highly focused on the task itself rather than spending time trying to figure it out, as we would've already spend that on the very start
The Problem Solving Notion
Step 1: Understanding The Problem at Hand
- The first step you are obliged to do the second you encounter a problem is to understand it deeply
- This is best done through asking question
- You'll get better at this step as you progress through your development journey
Step 2: Break Your Problem into Smaller Tasks
- This build on the last step, in this step your goal is to break your problem into small manageable tasks that are actionable
Step 3: Do Your Research
- After step 2, your bound to run into tasks you can't solve, this is where stack overflow comes into rescue
- It's important that you Program, not code
- While coding is copy pasting solutions on the internet, programming is understanding the code and how it functions
- only by programming, do we fully complete the research phase
- It's important that you Program, not code
Step 4: Write Pseudo-Code
- for highly complex tasks, it becomes profitable to try to pseudo-code the task at hand
What is Pseudo-Code
- pseudocode is the representation of our algorithm in precise English (or some other human language):
- Example:
- Pick up phone book
- Open to middle of phone book
- Look at page
- If person is on page
- Call person
- Else if person is earlier in book
- Open to middle of left half of book
- Go back to line 3
- Else if person is later in book
- Open to middle of right half of book
- Go back to line 3
- Else
- Quit