Improve Concept Exercise: Functions (Lasagna Master)
See original GitHub issueGetting started
Here you can read about what Concept Exercises are and how they are structured:
If you have not done so yet, it is probably also helpful to do a couple of “Learning Exercises” (this is how they are called on the site) yourself.
Goal
The goal of this issue is to improve the existing concept exercise Lasagna Master that teaches the functions
concept.
The exercise is already in good shape but to save some time before V3 launch, the about.md is very limited at the moment and some other bits and pieces are missing. Here a more detailed list of what could be improved.
Exercise Improvements
- There is currently no task related to function expressions. It would be nice to have one but it should not go to far into the territory of e.g. the
callbacks
concept.
About.md Additions
The about.md file is currently mostly a copy of introduction.md with some minor additions. Here some ideas what could be added.
- The arguments array and its pitfalls
- How to mitigate pass by reference issues (how to avoid modifying the input by mistake), e.g. copy object
- Maybe some more details on when to use function expressions
- Explain that function declarations are hoisted and function expressions are not
- Add a reference to the recursion concept
- The scope section should link to a variable concept that explains variable shadowing
- IIFE
- https://github.com/exercism/javascript/pull/1183/files#r684702295
Possibly we could also include some more general recommendations regarding functions.
- Good names for functions
- One functions / one purpose
- Avoid side effects / pure functions
- How to use functions with good names to clean up code/as comments
- How function names are determined (see also https://github.com/exercism/javascript/pull/1160#discussion_r654697390)
Collect Ideas for Analyzer Comments
If you feel like thinking about analyzer feedback but don’t feel confident to build it directly, you can collect ideas for the analyzer in the design.md file. Just add a ## Analyzer
section. You can see an example here.
Help
You can choose to do this solo-style, or collaborate with multiple people on this. The suggested approach is to
- First accept this issue by saying “I’d like to work on this” (no need to wait for a response, just go with it) and optionally request that someone works with you (and wait for a second person to accept your request).
- Use this issue to discuss any questions you have, what should be included in the content and what not and to collect reference material.
- Create a PR and set “exercism/javascript” as reviewers. Additionally you can write in #maintaining-javascript that your PR is ready for review. Once you incorporated any critical feedback that the reviewer might give you and the PR is approved, it will be merged by a maintainer.
Credit
This contribution grants you an author slot for the functions concept. Add your username to the authors
key in the config file.
If you also improve the exercise you can add yourself as a contributor there (or as an author in case of substantial changes).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
I’d like to work on this! I want to add a few recommendations for good function names and a few examples of bad function names and good function names.
@Aung1998 👍 Sounds good. Please keep it concise and try to focus on guidelines that are kind of consensus in the community.