go icon indicating copy to clipboard operation
go copied to clipboard

Implement New Concept Exercise: Channels and Select

Open andrerfcsantos opened this issue 3 years ago • 5 comments

Getting Started

If you have not yet contributed to concept exercises before, this task requires some upfront reading to acquire the necessary background knowledge.

Here you can read about what Concept Exercises are and how they are structured:

Also, be aware of these general guidelines:

Goal

The goal here is to create a new concept exercise that teaches about channels and select. That includes writing a concept and creating a new exercise.

Concepts

The following concept needs to be created:

  • channels

You can use the introduction.md file of the concept also as introduction.md file of the exercise. No need to create different content at this point. Additionally, if you want to save some time it is ok to not have an extensive about.md at this point. It can also be mainly the instructions.md content, maybe with some additions you would like to make.

Learning Objectives

The student should learn about the following topics and then practice them in the concept exercise:

  • understand what channels are
  • using channels as a way to synchronize goroutines
  • the difference between buffered and unbuffered channels
  • closing channels
  • for loop over a channel: for x := range ch { ... }
  • use select to receive from several channels

Prerequisites

  • functions
  • for-loops
  • range-iteration Additionally, it can be assumed the student already knows goroutines.

These prerequisites should be listed in the config.json entry for the exercise. The prerequisites above are a baseline of the prerequisites that might be needed for the exercise. When implementing the exercise, feel free to add more prerequisites if the exercise needs them.

Story

Try to think of a story for the exercise that ties all the tasks together. The story doesn't need to be highly complex. Even a small story goes a long way to improve the enjoyment of the exercise.

See https://exercism.org/docs/building/tracks/stories for inspiration.

Resources

Some links that might be helpful as a starting point and/or for the links section of the concept:

How to proceed

  1. First accept this issue by saying "I'd like to work on this" (no need to wait for a response, just go ahead).
  2. Use this issue to discuss any questions you have, what should be included in the content and whatnot, and to collect more reference material.
  3. Create a PR and set "exercism/go" as reviewers. Additionally, you can write in #maintaining-go on Slack 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.

andrerfcsantos avatar Apr 13 '22 00:04 andrerfcsantos

I'd like to work on this

RezaSi avatar Jul 14 '22 18:07 RezaSi

@RezaSi I discussed with @andrerfcsantos and we decided that it is fine for this exercise to assume that the student already knows goroutines. So when you move on to creating the exercise, goroutines can be included. I adjusted the description above accordingly.

junedev avatar Jul 16 '22 12:07 junedev

@RezaSi I discussed with @andrerfcsantos and we decided that it is fine for this exercise to assume that the student already knows goroutines. So when you move on to creating the exercise, goroutines can be included. I adjusted the description above accordingly.

Tnx, and yes goroutines are needed for this exercise. I already started it(https://github.com/exercism/go/pull/2324) and I need your advice on my PR.

RezaSi avatar Jul 16 '22 12:07 RezaSi

@RezaSi Yes, I am aware you are waiting for a review. 🙂 Sorry for the delay but I (or André) need to find some slot where I can really focus on this. That's not always easy to arrange with work, family etc.

junedev avatar Jul 16 '22 12:07 junedev

May I work on this issue?

Azanul avatar Jul 04 '23 08:07 Azanul