Ok ok I get it! You are surely asking yourself, what's all this? 😅
I hope you aren't frustrated after reading that definition. The idea wasn't to intimidate or frighten you but to make you have a big picture before we get started.
With that being said, let's unpack that definition
As you might already know, every program that runs on your computer needs some hardware resources, such as memory and the CPU, to do its work.There exist low level languages, such as C, where you have to manage these resources manually—for example, asking the computer for memory to create a new variable.
This makes the language easier to learn and use, but the downside is that programs built with such languages will never be as fast or as optimized as C programs.
Now, one of the powerful tools that take memory management away from us developers is garbage collection.
To be honest, this definition still sounds abstract, but don't worry, it will become more clear as we move on. The three most popular paradigms are:
Procedural programming is what we've been doing so far, basically just organizing the code in a very linear way and then with some functions in between.
We will talk about object-oriented and functional programming in a second 😉.
We can classify paradigms as imperative or as declarative, but again, more on that later.
Have you ever wondered why we can create an array and then use the
push method on it, for example? Well, it's because of prototypal inheritance.
Basically, we create arrays from an array blueprint, which is like a template, and this is called the prototype. This prototype contains all the array methods and the arrays that we create in our code, then inherits the methods from the blueprint so that we can use them on the arrays.
But since this is just a high-level overview lecture, I wanted to introduce this topic right here.
We have already used the power of first-class functions without knowing that they are called first-class functions.
Do you remember the below piece of code that we wrote for closing the modal window that we built before?
From the above code we can see that, we pass the
closeModal function into the
addEventListener function as if it was just a regular variable.
Also, the type of variables can easily be changed as we reassign variables, and this is basically what dynamically-typed means.
This, in my opinion, is a really complex topic and probably the most complex one of the whole course, which is why we are going to add lectures on these topics at the end.
In computing, a thread is like a set of instructions executed in the computer's CPU. Basically, the thread is where our code is actually executed in a machine's processor.
Now just imagine we have a long-running task, like fetching data from a remote server? Well, it sounds like that would block the single thread where the code is running.
But of course, we don't want that. What we want is the so-called non-blocking behavior, and how do we achieve that?
Well, by using a so-called event loop. The event loop takes long-running tasks, executes them in the background, and then puts them back in the main thread once they are finished.
It sounds like a mouthful for sure, but in the end, it really just compresses to this. Just keep in mind that, again, this is a huge oversimplification that we will come back to.