Struggling with Promises – 'Translation Service' exercise

This is the very last module on the JS track syllabus. Suddenly I just don’t follow. It feels like a big jump from the other modules with nothing leading you into this last one – that’s how it feels to me at least

I keep coming back to this thinking maybe now I can tackle it, but nope. I’m not really sure how to proceed. Or where exactly I’m stuck. I’m clearly missing something.

Does anyone have any advice?

Hey @MikeHud,

asynchronous programming is hard to get your head around the first time. When my programming mentor back in the day introduced me to concurrency and parallelism he said: “You need to be very strong now, until now you’ve lived in a perfect (synchronous) world, but now I’m gonna ruin it for you by showing you that the world isn’t actually that simple and perfect.” (or something along those lines anyways) :D

It’s kind of hard to give you specific recommendations, if you’re not sure yourself where you are stuck. Did you write any code that you could share or are you not even sure where and how to start?

One general advise that I can give is the following procedure:

  1. Write some code
  2. Explain to yourself (or your rubber duck) what you expect to happen
  3. See if the output matches your expectation
  4. Try to find out why it behaves differently from your expectation / where your mental model was wrong

Don’t be afraid to write some code that you’re sure won’t work, get started and iterate.

To understand Promises I can recommend watching some Youtube video(s), imo it’s just easier to see asynchrony in action than to read about it. I personally like the way Traversy Media explains things, so that’s my go to Javascript channel:

Note that this is a crash course, for a tutorial that moves more slowly you can check out the video from freecodecamp or just search for “Promises Javascript” and choose one that you like: Asynchronous JavaScript Course (Async/Await, Promises, Callbacks) - YouTube

Maybe after watching a video the concept of Promises is more clear, or at least you can pinpoint at which point you get lost?

1 Like