lab-brussels-1 / home

Home repository for Lab Brussels 1.
https://lab-brussels-1.github.io/home
MIT License
4 stars 5 forks source link

Cristobal Lopez: Asynchronous programming, 3 weeks #386

Open alexander-lopez-s opened 2 years ago

alexander-lopez-s commented 2 years ago

Learning Objectives

alexander-lopez-s commented 2 years ago

Week 1

I Need Help With:

What went well?

What went less well?

Lessons Learned

Sunday Prep Work

danielhalasz commented 2 years ago

I need help understanding what defines the order in which the tasks will be performed. Let's say that we have 4 functions in a program. 2 of them have 0 as SetTimeOut value, the other two have 2000 milliseconds and 4000 milliseconds respectively. Is the system going to process the functions with the greatest values first and execute the ones with 0 milliseconds last or viceversa? Or does the system read in a descending way?

the number represents the time in milliseconds, how long the delay, or time out shall be to start executing the function, once the event queue is empty..in your example, once the queue is empty, the two with 0, then 2000, then 4000 will be the order in which they will run

alexander-lopez-s commented 2 years ago

Week 2

I Need Help With:

export default getUser;


-  Why is the difference between `script type="module"` and `script type="text"`?
-  Let's say that I created a list <li> dynamically with JS. Why when I try to use this list inside another function, it cannot be found? It looks like the list only exists within the function where it was created. 
- How can we make our API DATA a global variable to have it available for our entire program without recalling it from the server every time we need it?

## What went well?
-  I was able to undertand how the API works and how to fetch some data.
- I worked in the small project and was able to display all the contact's information from the API.

## What went less well?
-  I understand the separation of concerns in theory but I am having a really hard time separating my files.
- I cannot understand clearly what await does. I might need a basic example but the tutorials are really complex.  

## Lessons Learned
- I learned what promises are in general. 
- I understand a bit about asynchronous programming. 

## Sunday Prep Work
- The exercises are too difficult in study lenses to complete them by myself (since the last 2 modules). I will do my best to resolve them. 
sammou00 commented 2 years ago

No worries , I will explain again with examples tomorrow

alexander-lopez-s commented 2 years ago

Week 3

I Need Help With:

What went well?

What went less well?

Lessons Learned

Sunday Prep Work

danielhalasz commented 2 years ago
  • Going back to separation of concerns, is this the standard convention that they follow in companies in real life? Or do they have different ways to distribute the JS code in companies? I am still struggling with this topic.

yes, most big codebases are separated.. the way it is done can be different, but the goal is always the same..to separate different sections of the code for easier teamwork and debugging

danielhalasz commented 2 years ago
  • Can I see a very simple and basic example of separation of concerns please?

all the examples in the SoC repo

you can also look for HYF final projects..this is one example.. https://github.com/BeHelp/BeHelp/tree/dev/backend https://github.com/BeHelp/BeHelp/tree/dev/frontend

danielhalasz commented 2 years ago
  • I do not know how to use the keyword this(), it have seen it many times in many tutorials.

avoid those tutorials :) this is something used in JS classes, that we do not use at all at HYF