Skip to content

Improve Concept Exercise: Functions (Lasagna Master) #1234

Open
@junedev

Description

@junedev

Getting 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 Add concept exercise objects #1160 (comment))

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

  1. 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).
  2. Use this issue to discuss any questions you have, what should be included in the content and what not and to collect reference material.
  3. 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).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions