Sprint 4 - Technical


Problem Solving Techniques

Blocked on a simple problem

During the Sprint 4 kata exercises I ran into quite a few problems which put my patience, calmness and perseverance to the test. I already started to struggle a bit in the "FizzBuzz" and "JS-Gradebook" challenges, but it got worse when none of my code was working in the "Built-in Methods" challenge. I tried for hours and hours and finally my body reacted with a panic attack and it felt like ice cold water was running through my veins. My inner voice yelled at me that I should have never enrolled in this bootcamp because I am simply not smart enough and I am never going to learn programming ( ! fixed mindset alert ! ). This awful feeling left me totally blocked and I had to step away from my computer to calm down and relax. The same night I had a very bad sleep.

In the next morning, I opened up the kata challenge again, and went through the sample solutions step by step, trying to understand each step, but also trying to figure out what exactly it is that is causing me trouble. Turned out, that I didn’t really understand how functions work. I couldn’t really find a pattern or structure or even some kind of format for functions. They looked messy to me and particularly nested functions just totally seemed to freak me out ( e.g. How can there be two ‘returns’ in one function??? or How is it possible to have so many ‘steps’ in one function without even storing some of the new values in a new variable??? ).

Here is an example:

Showing a JavaScript kata test.
Capitalization kata test

In this exercise, the task was to ‘simply’ capitalize the first letter of all the words of a given string using JavaScript built-in methods. I knew what I had to do and put it down into pseudocode explaining the steps in simple English but I just couldn’t figure out how to turn it into a function. After hours of trial and error, browsing through Google and console.logging each step, I gave up and had a look at the solution. My pseudocode was correct but I simply didn't manage to convert it into a ( nested ) function. Showing a solution for a JavaScript kata test.

So, I dedicated a few hours just watching a few more youtube tutorials on functions and built-in methods.

What I have learned throughout this process is that I ran through the JS basics too quick. I should have invested more time in practicing and just having a go in “playing” around with functions. The EDA learning material also recommended to spend a bit of time researching built-in functions, but I just skipped that part and jumped right into the exercise. I found a great youtube tutorial from Traversy Media about built-in functions, which would have helped me to solve this task a lot better if I had watched it before.

I also should have reached out for help from my peers or facilitator. The feeling of frustration and panic can be a lot worse than overcoming one’s pride and ask someone for support.

Another big note to myself ( and anyone else who experienced similar ): Be patient with yourself! No one will become a JavaScript master in less than 2 weeks.

Solved a problem in an elegant way

After having solved the “FizzBuzz", “JS Gradebook” and “Built-in Methods” in a rather inelegant way ( aka looking into the sample solution after hours of trial and failure ), I really nailed the last one “JS Olympics", which was a huge satisfaction and encouragement for me.

After watching several tutorials about functions and examining each of the sample solutions of the former katas, I was not only able to solve the last kata in less than 1.5 hours, but also to apply what I have learned about ES6 arrow function expressions on some of my solutions, which made them look a lot more elegant, more compact and cleaner.

Here is an example:

Showing a JavaScript kata solution.
Reversing strings kata test solution

In this task, we had to reverse a string. ( e.g. ♡ !tpircSavaJ evol I )
The steps involved in this task were:

  • Split the string into an array of words
  • Reverse each word in the array
  • Join the array of words back into a string
  • Return the string

I managed to solve all 4 steps in just one line of code.

I also got a lot better with my Google researches throughout the kata challenges. I gained a better feeling for the right vocabulary that gets me the best and quickest results from my Google search, and I found out which sources are more helpful for me than others.

All in all, it felt pretty good and rewarding to see me improve just within this sprint 4 week.

My confidence with problem solving techniques

  • Pseudocode: I find writing Pseudocode very helpful to identify the actual problem that I have to solve. When I read the instructions, I often have a lot of ideas rotating in my head and writing them down in pseudocode helps me to get them sorted.
  • Trying something: Yep, I am doing this all the time and most of the time it leads to errors which can be frustrating. However, I think this is a great technique for me to explore and learn what different "things" do to my code. I use it in conjunction with console.logging to check out what my code is doing at different stages.
  • Rubber ducky method: I have used it a few times by just talking to an imaginary person ( I am home by myself, so don't need to be worried that people will perceive me as psycho ). I find describing a problem verbally is a very powerful tool which helps me to think about a problem in more depth, breaking it up in smaller portions and explaining it in clear and simple words.
  • Reading error messages: It definitely helps me to find the smaller mistakes in my code ( e.g. missing parenthesis, etc. ).
  • Console.logging: I love it and use it all the time to check if my code is working the way I want it to work.
  • Googling: Best friend and one of my most used techniques which helped me a lot in the kata challenges. Every solution is already out there in some form but it really takes some practice to google effectively. There is still some room for me to improve.
  • Asking your peers for help: Fail! I feel super uncomfortable asking people for help through Slack and haven't done this yet. I do recognise that it can be an extremely helpful technique, though, for when I am really stuck and/or start panicking. Once I am in the bootcamp, I am sure I will ask peers for help all the time because I find talking to someone much easier than communicating through Slack.
  • Asking coaches for help: Same with this one. One thing that is holding me away from asking, is that I sometimes don't really know how to describe my problem. But as the challenges get more and more complicated, I am definitely a lot closer to ask for help.
  • Improving your process with reflection: This is a very important technique for me as I still have a lot to learn. I usually look back at the end of each day and recapitulate everything I have learned, things that went well, the one's that didn't and what I can do better tomorrow or which learning material I should better repeat or deepen with some further tutorials/practice.