Problem solving is what coding programs is all about. How effective a programmer's problem solving is may be the difference bewteen a well structured functional program and a poorly functioning one.
A time recently when I was blocked on a simple problem:
Problem: Gradebook: when attempting the challenge I wasn’t even really sure where to begin with some aspects of it. I seemed to be completely blocked when attempting to write the code. It’s one thing to follow code that’s already been started, another thing entirely to look at a problem and decide what to code. I found myself in a place of complete uncertainty, which was a most uncomfortable feeling.
Techniques I used to help solve the problem: pseudocode, trying something, Googling and researching, asking peers and coaches for help. In the end I sat with a facilitator and we worked through the various problems together. However I still thought at the end I didn’t really have a clue what I'd been working on.
How I felt: I felt concerned that I hadn’t taken it what I’d been studying in previous week's sprints. However, I also know that I had been putting in long hours over the previous couple of days and perhaps would benefit from a break. After finishing with the facilitator I decided to take a break for the rest of the day, reflected on the day and got a good night sleep. The following day I worked through Built-in Methods problem and had a much improved day.
How I elegantly solved a problem:
Built-in Methods:
Pseudocode, trying things, console.logging, Googling and researching, asking peers/coaches for help.
Initially I was concerned that I was going to have similar difficulties as the previous day however, after a good night sleep, a fresh brain, perspective and new set of problems to solve, I managed to work through built-in-methods gradually and consistently until I had worked out the various problems, largely without help.
What I learnt from being blocked and solving problems elegantly: something that I already knew, that sometimes the best thing one can do is take a decent break and reflect on the problem at hand. It gives me confidence heading forward into the new week, looking ahead to the end of the current foundations period of this study and foreard to bootcamp.
How confident am I using varoius problem solving techniques/processes?:
Pseudocode: writing bullet-points for each step I’m going to take. Kinda like how I write something like an essay. Very natural to me work this way. I start an essay by writing a general outline in bullet-points of what I'm going to write about. Similarly using the same technique for what I will be coding.
Trying something: my main form of attempting something when I’m not sure where to start.
Rubber ducky method: I don’t have a ducky, rather I have a unicorn a friend gave me. I’ve started talking to the unicorn However, it’s not natural for me to sit and talk to the unicorn just yet.
Reading error messages: it’s a good guide for where exactly the problem is in the code, but I’m not yet very adept at using it.
Console.logging: often I forget to console.log and remember it as an afterthought. Sometimes I’ll look to console.log and be unsure which aspect of the code I’m needing to console.log to get the output I need to view.
Googling: so far my main form of searching for an answer to a coding problem. I’m starting to get an idea of which are the best sources to utilise when googling e.g. MDN Web Docs, W3Schools.
Asking peers: I’m comfortable jumping on Discord and posing questions to the wider Dev Academy group when I think I have exhausted my ability to solve a problem.
Asking coaches: again I'm comfortable seeking help from facilitators when I have exhausted my own ability to solve a problem, but I like to attempt things myself first.
Reflections: reflection is something I’ve used throughout my career as a nurse and this course is a good reminder of how useful reflection is, particularly when attempting to learn something new.