-
-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Fruit Picker -- remove conceptual leaps #1725
Conversation
Dear neenjawThank you for contributing to the JavaScript track on Exercism! 💙
Dear Reviewer/Maintainer
Automated comment created by PR Commenter 🤖. |
First attempt here just to simplify this exercise and improve the progression to make it more clear that we are trying to teach that call backs are just functions given to some function to invoke (or not) to induce some behaviour. Feedback welcome. Todo:
|
@junedev, no wasn't initiated with a specific issue in mind. Received a lengthy discussion of someone's frustration and decided to revisit this exercise to remove/clarify/straighten a few concepts. Plan is to focus in on the idea that callbacks are just functions passed to other functions to execute on their terms. |
However, I think it would be reasonable to link (or assign) that issue to make sure those ideas are covered. |
- introduction tidied - about tidied - created empty helper module function to satisfy eslint checks - removed arrow-function concept from taught concepts
@SleeplessByte @junedev, this is now ready for your review |
@neenjaw Sorry for the long delay in reviewing this. @SleeplessByte and me have been very busy. Things are normalizing on my end now so I will probably get around to reviewing this in the next 1-2 weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally finished the review. If you don't have time to address the comments, leave me a note and I can finish up for you if you want.
|
||
If the `callback` function _returns_ a boolean or boolean-like value, which is intended to be used (as opposed to a throwaway return value), it's called a predicate. | ||
## Specific examples of callback functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about having a the category for all the forEach, map, filter, etc methods in JavaScript? I often notice beginners don't understand that the argument is a callback function that will be applied to the elements. I think it would be good to include it as a first example category in the list. However, I am not sure how to name the category ... maybe "Iteration Callbacks" ... idk ... maybe you have a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't those array methods taught in other concept exercises? Shouldn't it be those exercises' responsibility to build on prior knowledge and point out that those array functions are callbacks in disguise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We (DJ and me) have the guideline that about.md files are not bound by the syllabus progression because they are used for later reference. So if something is a good fit to explain a concept, we would include it in the about.md no matter where it would show up in the concept tree (if at all). My feeling is that the current example categories have some "overweight" on the complex side. That is why I though a simpler category would balance it out. Not a blocker though. Feel free to click resolve if you prefer it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detail added in dd155a5, sub-titled as "Callbacks in disguise"
to be addressed later as they are not explicitly taught in the context of this exercise.
- added basic example to about - added detail about array prototype function which use callbacks
@junedev see commits with revisions based on the reviewed feedback 😄 |
@neenjaw Thanks a lot for the update! |
Love the changes <3 |
Hello. How can I assist in updating the hints? This is my first attempt at contributing to Exercism. |
This exercise was lacking in its ability to teach the concept of callback functions --- a programming technique to facilitate control flow and code re-use.
This is an attempt to simplify this concept. As such it removes the taught concept of
arrow-functions
, so there is now no exercise which teach this concept. Likely arrow functions should be taught in closer with the concept ofthis
as its main benefit (aside from a more concise syntax) is the difference in its handling ofthis
.