HomeGitHubAboutBlog

I finally started again

23 January, 2020 - 3 min read

I finally started blogging again

I have been trying to get myself to write again, at no avail. Now that I am starting a bootcamp in a few days, I would really like to keep track of my progress as I go along.

Hi, my name is Thabi. I am a South African girl living in Berlin, I recently moved here after living in China for almost 5 years. I started learning how to code out of curiosity while I was there, and then from that moment I realized that I want to make a career out of this.

I cannot believe I went from this:

console.log("Hello World");

to understanding more complicated code. Now that all the introductions are over, I can get to the point.

I am trying to focus on a "no zero days 2020", which means, no matter how tired or annoyed I am, I should do one programming exercise per day. So far, I failed. Mainly because I was in London for my birthday and did not touch any code. Now that I am back I can track what I have done so far.

So what did I work on today?

  • I went through another chapter of Handling Events in Eloquent Javascript. To be honest, I lost track when I got to debouncing and timers. I need to go through it again or find a more interesting resource.
  • I did the exercise "balloon" in the same chapter, I had about 50% of an idea of what I should do but my patience got the better of me and I just looked up the solution, I was stuck on how to target the arrow keys with addEventListener. Here is the solution, you will need to create a paragraph element with the balloon you want to target.
let balloon = document.querySelector("p");
  let size;
  function setSize(newSize) {
    size = newSize;
    balloon.style.fontSize = size + "px";
  }
  setSize(40);
function handleArrow(event) {
    if (event.key == "ArrowUp") {
      if (size > 70) {
        balloon.textContent = "💥";
        document.body.removeEventListener("keydown", handleArrow);
      } else {
        setSize(size * 1.1);
        event.preventDefault();
      }
    } else if (event.key == "ArrowDown") {
      setSize(size * 0.9);
      event.preventDefault();
    }
  }
  document.body.addEventListener("keydown", handleArrow);

I only got this book just before I went to London so I did not have much time to go through it yet. I really liked the quotes in the beginning of the book, it is always important to remind yourself to not be too hard on yourself. One particular quote that stuck out to me was:

When you are struggling to follow the book, do not jump to any conclusions about your own capabilities.

If this isn't the textbook definition of me! I really need to work on this before I start the bootcamp or else it will hinder my progress. Alright that is the end of my post, now I need to figure out how to deploy this site to netlify and hopefully adding additional posts wont be painful.