Infinite Loop in Simple Problem
What was the Problem?
When I have finished the gradebook part which is one of Kata projects, there was an issue that I
could not identify what has caused the problem.
It was to write codes to create a fresh gradebook with given parameters which was not really hard
part but I got stuck in an error which was saying that scores were not in the gradebook.
Even though I printed out the result using console.log() at the end of each line to check if each of
them was functioning properly and the codes actually returned correct results that I was expecting.
But the error message was still happening, so I had to try other ways to sort these out.
What Problem-Solving Techniques Used?
I have used two techniques as below:
1. console.log(): Placing this at the end of each line to check if each line of codes has correct
output as expected.
2. Checking error message and test file: Checked test file closely to clearly understand what needs
to be done to satisfy all the requirements to pass the test then have a look at error messages to
know from where it went wrong that resulted not returning the correct output.
After an hour of struggling with it, I finally found out that one of the variables was spelled wrong
by missing a letter at the end of the word.
The code to create a value of an object was supposed to be 'gradebook[students[i]].testScores =
scores[i]' in a for-loop however I realised that I made the value name as testScore, that has caused
not being able to pass the test.
Even though the returning output seems to be fine to me however the value name of the object was
named incorrectly to pass the test.
Feeling Throughout The Process
It was surely annoying that it keeps showing error when I tested the file like hundreds time at some
place which I did not know.
However when I finally managed to figure out the problem after struggle, it made me astonishingly
happy that I have solved it eventually.
The process was not easy as I kept trying other alternative codes to make it work, trying to change
the parameters, and extra things to sort that out.
And the feeling that came to me when I have realised that the cause of this problem was a missing
letter was totally void but it was ok.
What Did I Learn?
From this event while doing Kata project, I have learnt a lesson that I should name the variables
name more unique and recognisable.
Not just limited to variables, it is also importtant to name things like functions and parameters
unique so I can know what each of them is there for even I look back the codes in the future.
Reflection on Confidency of Problem-Solving Technique
Reading error messages
Thoroughly reading error messages clearly tells me what went wrong in the codes. So I could think
about what kind of measures I can take action to solve the problems.
Using test files or debugging features in this context really help finding errors within the codes.
Realised that why TDD methodology is important for developers to be involved in.
Applying these useful features deeply into my development environment will improve the quality of my
codes to prevent any potential errors and issue that might incur fatal failure to the codes.
Console.logging
Using console.log() method for reviewing the codes was also useful during the coding challenge. So I
could know what output the each line of codes actually returns.
By doing so, I could be able to solve the issue, which was stated above, even though it took longer
time than I expected.
Googling
For sure to be honest, I have used a lot of Google search while completing the Kata challenge
everytime I got stuck.
Searching the built-in methods in MDN website and other references to find their correct syntax to
make the codes work and how they could be simplifed in shorter code by refactoring were most things
I have done during this challenge.
What Can Improve My Problem-Solving Skills?
Ability
Problem solving skills are not lierally same as algorithm. it is difficult to see problem-solving
ability as the same meaning as algorithm, and problem-solving ability can include understanding of
algorithms, but algorithms cannot be seen as the whole of problem-solving ability.
First of all, the important thing in problem-solving ability is to derive a problem through a clear
requirements analysis.
When a requirement for a function or service arises, in most cases, the focus is mainly on why the
function or service is needed in each case, and how to solve this problem is the developer's
competency to bring with.
It is good to keep questioning to myself by asking 'what was the problem and why did I try to solve
it?' repeatedly. People who focus on how to solve problem are highly regarded as developers.
The ability is especially important in development because there is always no exactly correct answer
for these problems.
After clearly recognizing the problem, it is important how to approach the problem. You need to be
able to decide whether the problem is something you can solve now, how to approach it if you can't
solve it, how to approach it if you can solve it, and what is the best option in the current
situation.
Growth Mindset
Regardless of career, it is very important to have the strong will to grow, and to achieve growth
based on
that will. There are many people who have a will, but very few people achieve growth based on that
will. It is easy to put your mind to anything, but the act of making something tangible is very
difficult.
As per what has been discussed about growth mindset in the neuroplasticity topic previously, I have
personally noticed that the connectivity between problem-solving skills and having growth mindset is
quite close. In this very fast paced IT industry with rapidly changing technologies, I will face a
lot of problems during this course and even at where I will get to after this course.
To endure all the difficulties I will confront everytime and constantly stand at stable position in
IT industry, I should keep this growth mindset in my mind to develop myself through these challenges
not seeing them as failure.
Trusting myself with positive self-esteem then will make me to think that I can improve myself
better and also will help me dealing with solving problems more effectively.
Having growth mindset in myself also means to embrace a certain amount of risk, constant
uncertainty, and the potential for failure when trying new things. However I believe that overcoming
from these challenges will gradually improve my persona to be a better developer and better human
being.