exercism / go

Exercism exercises in Go.
https://exercism.org/tracks/go
MIT License
1k stars 654 forks source link

[Discussion] Ideas for new Concepts #1886

Open junedev opened 3 years ago

junedev commented 3 years ago

Concept Roadmap

There are already a lot of ideas for additional concepts that we could cover with concept exercises in the future.
You can find a list in our roadmap document: Roadmap - Potential Future Concepts

We already created issues for the following new concepts:

Additionally some concept exercises that exist but need major improvements are not yet visible on the website (status "wip").

Purpose of this issue

MikaeelMF commented 2 years ago

Hi! I was wondering if we can add networking related concepts to the roadmap. I personally suggest creating a prerequisite exercise on events first and then create an exercise to implement a basic http server and client.

andrerfcsantos commented 2 years ago

@MikaeelMF We definitively can consider it :)

When do you say a prerequisite on "events", what are you thinking exactly? Something like callbacks?

MikaeelMF commented 2 years ago

@andrerfcsantos Great! About the "events", sorry it was my misunderstanding. I mistakenly thought Go has events like what we see in socket.io for socket programming, but upon further reading I understood this is not the case. On another note, explaining callbacks before discussing http servers is a great idea!

andrerfcsantos commented 2 years ago

@MikaeelMF Some frameworks do need to handle events and they do it with a callback like you'd do in javascript. But since Go is strongly typed, each event has to be represented by a type and an handler for that event must be a function that receives the event as an argument. An example of this is discordgo. This is a library to make discord bots, and to make a bot you must declare handers for the events discord sends that you are interested in. The way they do it is by having a generic AddHandler() (ref) function you can use to register an handler. This function takes another function as an argument and depending on the types of the arguments of the function that is passed in, an handler for the corresponding event will be registered. The corresponding event of the handler is figured out by performing a type assertion on the handler function that is passed in.

So it's definitively possible to have event handling in Go, although it might not be as trivial as in other languages. I'm not sure if teaching students events in this form is useful, but i definitively can see an exercise teaching more about networking and maybe the net/http package, by making the student do a simple server/client. The only caveat is that the tests in the online editor run in containers without network access, so all clients/servers must not contact external services for their requests.

MikaeelMF commented 2 years ago

@andrerfcsantos That is pretty interesting! I am new to Go so these topics are a bit unfamiliar for me, I will definitely look further into it! Thank you for your explanation.

About the constraint that you have mentioned, so is it possible for clients/servers to connect to localhost:random_port and communicate with each other?

andrerfcsantos commented 2 years ago

About the constraint that you have mentioned, so is it possible for clients/servers to connect to localhost:random_port and communicate with each other?

This should work, yes.

MikaeelMF commented 2 years ago

About the constraint that you have mentioned, so is it possible for clients/servers to connect to localhost:random_port and communicate with each other?

This should work, yes.

Great! I am interested in working on this topic. If it is ok, could you write up a guideline for me so I can start working on it?

junedev commented 2 years ago

@MikaeelMF I created a dummy issue for you here: https://github.com/exercism/go/issues/2242 I would recommend you start by thinking about the learning objectives. That means creating a short bullet point list of the things you want to teach in your concept document and concept exercise. You might also want to add a list of things you don't want to include so the scope stays reasonable. You can put the list as comment in the issue I linked. Then a maintainer can check your plan and you can start working on the concept and exercise.

FYI The lists then later become part of the design.md file of the exercise in the repo so they are not just for us.

MikaeelMF commented 2 years ago

@MikaeelMF I created a dummy issue for you here: #2242 I would recommend you start by thinking about the learning objectives. That means creating a short bullet point list of the things you want to teach in your concept document and concept exercise. You might also want to add a list of things you don't want to include so the scope stays reasonable. You can put the list as comment in the issue I linked. Then a maintainer can check your plan and you can start working on the concept and exercise.

FYI The lists then later become part of the design.md file of the exercise in the repo so they are not just for us.

Great! Thanks!

ghost commented 2 years ago

Can we add "Cryptography" to the concepts roadmap? I'm not sure if it is already in the roadmap because the linked webpage shows a 404.

junedev commented 2 years ago

@saurami I fixed the link. The one at the top leads to the same page and that one was working.

Re cryptography: The syllabus is not about teaching programming concepts in general (we will have separate content for that on Exercism in the future). It is about "How to do X in Go?". Keeping that in mind, would be great if you could add some more thoughts on what you would like to see covered under "Cryptography in Go".

ghost commented 2 years ago

Thanks @junedev.

I'll go over some cryptography concepts this weekend and see if a concept exercise can be implemented.

This could be sort of a prerequisite for the "Diffie-Hellman" practice exercise.