Freecodecamp: Add explanation or link about what "chaining methods" means in ES6 challenge

Created on 28 Aug 2020  路  11Comments  路  Source: freeCodeCamp/freeCodeCamp

In the ES6 challenge "Handle a Rejected Promise With Catch", the reader is told" "Note: the then and catch methods can be chained to the promise declaration if you choose."

Nothing so far in the Javascript curriculum has explained what it might mean to "chain" methods to the promise declaration. I would propose one of two changes here:

  1. add a hyperlink to a good resource that describes chaining methods to promises (this link at javascript.info is what explained it for me); or
  2. add another example that shows what promise chaining would look like.

I hesitate to write a PR doing solution (1) because I can imagine there are restrictions on outgoing links.

What do you think? Is (1) a good idea? Or (2)?


Describe your problem and how to reproduce it:

Add a Link to the page with the problem:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/handle-a-rejected-promise-with-catch

Tell us about your browser and operating system:
NA
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

help wanted learn

All 11 comments

I hesitate to write a PR doing solution (1) because I can imagine there are restrictions on outgoing links.

I don't remember coming across a lesson in the javascript section linking to an external site for better explanation. Wouldn't it even be better to add a lesson explaining promise chaining than link to an external site if it has not been explained anywhere in the lesson series? TBH i see promise chaining used a lot.

@nibble0101 Yeah, I don't see a lot of external links, so an explanation of promise chaining seems like the way to go. Not sure if it needs another lesson or could be explained here.

Hello there,

You are correct, we try as much as possible to avoid links to external resources. One of the main ideas behind the challenges in this version of the curriculum is stated in the contributors docs:

Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.

As for the issue with campers potentially never having heard of _"chaining"_, in my opinion:
1) Campers do not need to know about it to complete the challenge. I suspect the reason the original contributor who wrote the note, did it to give campers something to research, and potentially practice. If a camper already knows about _chaining_, then they will not give it a second though. If not, then perhaps, like yourself, they will research into it. Either way, the instructions do not ask for _chaining_ to be used.
2) The note could be removed. I would not spend time explaining chaining in this challenge.

Obviously number 2 is not my preferred choice of action, because I appreciate the _tid-bits_ of information given in some of the challenges which helped me learn by prompting me to research.

Hi @Sky020 . Well it is understandable to give learners something to research about but my honest opinion is if you decide to do it, then you must clearly state so. Looking at the wording of the note:

Note: the then and catch methods can be chained to the promise declaration if you choose.

From the above statement there is a very high likelihood for a learner to ignore the note because it is an alternative to the already explained method. I would most likely ignore it too, given the amount of material i have to learn, if i were the learner.

Yes the task at hand may not need someone to know promise chaining to complete but do you think the concept is not important enough to include in the lesson series or as part of this lesson? In fact my very first encounter with promises is with the fetch API which is more often than not implemented via promise chaining. My honest opinion is that ignoring it up to the point of just giving a one line "Note" is an oversight.

@nibble0101 I fully understand where you are coming from.

My main issue with including anything about _chaining_ in this context or _fetch_/_ASYNC_ context is .then and .catch are not a part of this topic - ES6. I would much rather a new lesson be created teaching _chaining_ in another block, and/or _TRY/CATCH_ being taught as the standard with _ASYNC/AWAIT_ in the ES6 block.

That being said, I am concerned this topic is going down bike-shedding, as the new curriculum should probably be the platform taking note of these points.

@Sky020 Thanks for weighing in. Your comment about the "new curriculum" is news to me. If that's where this discussion belongs, that's fine with me.

On the substance, as a beginner, I think the bare-bones note about promise chaining here does more harm than good. So given that there is no appetite for explaining it here, I would favor deleting the note.

@moT01 Since you originally created this challenge and included the note, could you share your thoughts on this issue?

Your comment about the "new curriculum" is news to me.

@bhagerty , In that case, I highly recommend you take a peak. Starting with these two posts announcing it:

@moT01 Since you originally created this challenge and included the note, could you share your thoughts on this issue?

I don't think I would expand this lesson to include teaching method chaining, since it would take away the focus of the lesson. Even an extra example might be much - I know there's many other lessons that are longer with many examples - but that's my opinion.

I wouldn't object to an additional lesson about it - but we aren't really adding lessons anymore in favor of the new curriculum.

So I think that just leaves either removing the note, or leaving it. I would be fine with either. I'm open to suggestions.

My suggestion is to take it out. This fits best with the contributor guideline quoted by @Sky020: "Campers should never have to google anything during these challenges. "

Right now, if a camper wants to understand the note, they have to google promise chaining. I realize that they don't actually have to google promise chaining because it isn't part of the challenge. But that's all the more reason to take the note out. It's just a confusing distraction.

Since we are not going to add an external link on the topic and we are not planning on adding a new challenge to the existing curriculum for the topic being linked, I think we should just remove the note.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vaibsharma picture vaibsharma  路  3Comments

imhuyqn picture imhuyqn  路  3Comments

jurijuri picture jurijuri  路  3Comments

DaphnisM picture DaphnisM  路  3Comments

kokushozero picture kokushozero  路  3Comments