Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

[Elixir] New concept exercise - protocols #2122

Merged
merged 5 commits into from
Oct 6, 2020

Conversation

angelikatyborska
Copy link
Contributor

This is my idea for the concept exercise about protocols. The draft includes the instructions, tests, and a sample solution.

@angelikatyborska angelikatyborska added type/new-exercise Add a new exercise status/draft This issue or pull request is a draft, and not ready for review/merge. labels Aug 2, 2020
Copy link
Contributor

@neenjaw neenjaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this exercise, I think it addresses some of our previous concerns about this concept.

It also easily extends to a followup where the derived or fallback protocols can be taught.

@ErikSchierboom
Copy link
Member

@angelikatyborska Is there anything I can do to help with this PR?

@angelikatyborska
Copy link
Contributor Author

@ErikSchierboom I have to admit I didn't forget about this PR at all, but I've been struggling to find motivation to code at all in my free time in the past 2 months. If you have any tips on how to fix that problem, I could really use some 😞.

I'll try to finish this PR in the upcoming week.

@ErikSchierboom
Copy link
Member

ErikSchierboom commented Sep 29, 2020

@ErikSchierboom I have to admit I didn't forget about this PR at all, but I've been struggling to find motivation to code at all in my free time in the past 2 months. If you have any tips on how to fix that problem, I could really use some 😞.

Don't feel pressured by me to start coding in your free, just do whatever feels best for you. As for tips on how to fix that, maybe check in on the weekly meetings on Fridays? They can help get one enthusiastic. An alternative could be to work on some low hanging fruit, as in things that are easy to do and require just a little bit of your time. A final suggestion could be to team up with someone to work on something together.

@angelikatyborska angelikatyborska removed the status/draft This issue or pull request is a draft, and not ready for review/merge. label Oct 4, 2020
@angelikatyborska angelikatyborska marked this pull request as ready for review October 4, 2020 16:04
@angelikatyborska angelikatyborska requested a review from a team as a code owner October 4, 2020 16:04
Copy link
Contributor

@neenjaw neenjaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I really like the conciseness of the introduction, the exercise makes sense, the after provides more context. This is a nice exercise. 🎉


## Implementing

It is possible to implement protocols for all Elixir types: structs, `Tuple`, `Atom`, `List`, `BitString`, `Integer`, `Float`, `Function`, `PID`, `Map`, `Port`, `Reference`, and `Any`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should structs be within backquotes too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that it shouldn't because it differs from all the other items in that they can be substituted for Y in defimpl X, for: Y do, but for structs you need to use the actual name of a struct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the above reasoning. A C# example: "classes" should not be in backticks (it is not an actual keyword), but class should be.

languages/elixir/exercises/concept/protocols/lib/rpg.ex Outdated Show resolved Hide resolved
Co-authored-by: Tim Austin <tim@neenjaw.com>
Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great exercise!

@angelikatyborska angelikatyborska merged commit 07593d9 into master Oct 6, 2020
@angelikatyborska angelikatyborska deleted the elixir-new-exercise-protocols branch October 6, 2020 11:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants