“Closurrreeee”

Friends scene. Rachel on the telephone to Ross. Rachel says “And that, my friend is what they call closure”

A round up of my second week in a Northcoders bootcamp.

The week is a part of our Javascript Fundamentals block. It has the same structure of the previous week, we would have katas and questions in the morning to work though then a lecture. Most likely structured in this way to enable us to get creative, and get thinking (read that as, get googling and scouring W3 and MDN for hints how to attack the challenge we are faced with.)

The course will at first introduce us to a concepts peripherals, and then re-visit the concept with a little more detail. I’m becoming a fan of this, although the content is full-on I have faith that the course is guiding us in a way to build up our knowledge without suffering burn out.

What we covered this week…

MONDAY: Test driven design & Jest

We were introduced to Test driven design or TDD, and testing with Jest. I can say I am a huge fan of both. If you are just learning as I am, I would definitely say to look into installing Jest!

TUESDAY: Dry & Pure functions. Scope & Hoisting.

DRY and Pure. Pure functions will not mutate the input and the input will always return the same output (which fits in perfectly with learning TDD) The concept of DRY is the idea that when writing code you don’t repeat yourself.

Scope and Hoisting. You can write a function but you don’t know why when you return a variable its coming back undefined then this is the lesson you need. It felt like a lot was happening today, two separate concepts delivered that dive into the WHY of Javascript. This lecture was fantastic, using diagrams and thorough explanations to help solidify our knowledge on what is happening in our code, we were introduced to the call stack, global variable, thread (local thread) and variable expressions . This lecture was then built upon throughout the remaining week.

WEDNESDAY: Values vs Reference.

Building on our knowledge gained in the previous two days we were introduced to values vs reference. In javascript data is separated into values, Primitive and Compound with the 7 main data types falling into the Primitive type. The variable that stores a primitive value is accessed by the value.

A variable that stores an object is accessed by reference, its own place in memory.

THURSDAY: Closures.

Sigh. This is what this weeks lectures have been leading to. Closures, easier to explain than to put into practice with TDD. I am so very pleased that this has been introduced to us so early in the course so we can consciously use them through the remainder of the bootcamp. I would advise anyone learning about closures to just write the code. Just keep writing code.

FRIDAY: Closures.

Closures give you access to an outer functions scope from an inner function.

To use a closure, you would need a function inside another function and return it or pass it to another function.

I am so very pleased that this has been introduced to us so early in the course so we can consciously use them through the remainder of the bootcamp.

Thoughts on this week

This week has been extremely full on. Every day felt like there was not enough time to accomplish what I wanted to do in a day. The concepts introduced this week have really stretched my brain, but by Friday I could write a TDD. Install jest and I could write a function that had a closure. Next week I can only get better.

If you go into this bootcamp you HAVE to be prepared to keep picking yourself up when you hit a wall. The concepts are hard, but everything is hard at the beginning. Keep going.

The key takeaway from this week is that rest is your best friend. There is no shame in taking an extra 10 mins away from the screen to absorb information, especially when the weeks start to get intense.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store