Problem solving is such an integral part of coding and in life in general too. I had considered myself pretty decent at problem solving. I love solving riddles, puzzles and playing problem solving games. But the past 2 weeks have really pushed me. Maybe because of the time constraints and the added pressure of this being a course that will determine the rest of my life or because the problems faced here are just more difficult than I have faced before. But either way, I was really challenged and sometimes I felt frustrated.
The problem solving techniques and processes were really helpful.
- Pseudocode helped in breaking down what I wanted to do. I didn't use it too much but when the code was a bit too complex it was really useful.
- Trying something was interesting because it was just random. I have used this method before in solving puzzles and tried to use it a few times here. I think it only worked once.
- Rubber ducky method I had never used before and was keen to try as soon as I read about it. Honestly it felt weird the first few times but now i'm slowly starting to get used to it.
- Reading error messages gave me an idea of what was wrong and where I needed to look. Sometimes it was helpful and sometimes it got me more confused than I was before.
- Console logging was something I never really did much of. Maybe a few times towards the end but now I feel like I should do more of it.
- Googling is definitely the first thing I do and my favourite of all the techniques.
- Asking your peers for help> saved me twice when I was stuck. It's a great way to see how other people are tackling the same problem you are.
- Reflection is really important after you have solved the problem. Especially if you asked for help with that problem. It is important to look back at the solution and fully understand how it works so if you face a similar situation again, it won't be too bad.
It is important to visit these techniques when facing a problem but also important to not get too frustrated when they don't work. Sometimes a problem that seems simple can baffle us and it takes stepping away from it for a while to solve it. When I was doing the Fizzbuzz kata, in the first part for the function where I wrote an if/else if argument, I had mistakenly used commas instead of semicolon. And this is something that I struggle with anyway. But for a long time I just couldn't find what was wrong with the code. I really had to leave it, go for a walk, come back and then it clicked.
For the second half of the same kata, again I was stuck and didn't know what was wrong with the code. I went on slack and asked some peers for help. And even though I didn't get the answer straight from them, just discussing the problem with them helped me in finding the issue and solving it quickly.