Paige Moore
Dev Blog

fancy letter P

Problem Solving

Got blocked on a simple problem

I got stuck on the cafe challenge in the previous sprint. This challenge was a follow along code where yo watched Joseph write out all of the code and you just followed along (easy right). But for some reason I could not get the cafe order to show, only showed as ,,,,,, rather than the actual order.

Solved a problem in an elegant way

I knew that the problem was somewhere in getting the product names to come through because the ,,,, was there so it was trying to do something but not the right thing. I ended up commenting out the bottom half of the coding and focused on just getting the information through, going step by step through each line to see where the error was .

What was the problem?

The problems was:
for (let i = 0; i <= orderSize; i++) {

let productIndex = getRandomInt(0, productNames.legnth - 1)
let productName = productNames[productIndex]
newOrder.push(productName)

}

What problem solving techniques did you use?

I went through each step and console.logged each one until it didn’t work. Then I knew where there was an error and went through the line of code to see what was happening.

Result: I spelt length wrong :(

How did you feel throughout the process?

I felt good about the process because I could see that I knew where the issues was and what is was and I worked my way to solving the problem without having to ask for help.

What did you learn?

I learnt that with console.log and commenting out sections you can really narrow down where the error is rather than having to look through the whole document.

Reflect on how confident you feel using the problem solving techniques and process:

Pseudocode:

I think pseudocode is a great way to set out a plan before starting. You have a to do list to work to and if something goes wrong you can refer back to the pseudocode for guidence. I personally love to do lists.

Trying something

Trying something actually surprised me a bit. I was completely stuck with a question and had no idea where to even start, and I didn’t want to ask for help again. So I wrote what I thought might be on the right track, was sure it wasn’t going to be right. But then I was right, proves that I do know most of what is being asked of me, but I get in my head about it being wrong before I even try.

Rubber ducky method

I find this to be my favourite method (not just because of the funny name) talking through each steps makes me realise that I didn’t actually do something.
Rubber Duck

Reading error messages

The error messages are sometimes helpful if it is an obvious error like you have an extra (. But most of the time when it is not right and I get an error. Following the error message leads me down a track that I don’t know what I am doing and I end up just starting all over again.

Console.logging

I use this quite regularly, I find it to definitely be the most helpful problem solving technique because you can see what is not working

Googling

Googling is always good. However because this is basic coding I find sometimes that the google results are a bit above my head so takes a few website to be able to actually understand what the answer is.

Asking your peers for help

I do find this to not be the most productive way to get help. A lot of my peers are amazing at trying to help and give lots of feedback. But sometimes it leads you down the wrong path because they are obviously learning as well. But then again I have had some complete gems of guidance from my peers.

Asking coaches for help

I don't really like asking for help from the coaches. I know they are focused on the bootcamp and I should be able to complete foundations by myself with out having to ask for help on simple things. But sometimes I am just completely stuck and need some guidance.

Improving your process with reflection

I also use this technique quite often, taking a step back looking at the whole picture and then moving forward.