christopheradams / christopheradams/elixir_style_guide

Best practice: How and where to put protocols and their implementation?

Open
#84 8 comments 0 reactions 0 assignees View on GitHub
discussion enhancement help wanted question
Dominant language
Elixir
Stars
4.4k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

I think it would help to have a common place to put protocol definitions and also implementations. It would be in particular interesting if protocols are implemented for existing modules.

For discussion:

definition:

```
file: lib/protocols/incredible.ex
```

implementation for a new modules within the module.

implementation for an existing module (e.g. Integer) in:

```
file: lib/protocols/impl/integer.ex
```

or

```
file: lib/protocols/integer_impl.ex
```

?

Contributor guide

Open the contributing guide

Research direction

Start by reading the discussion on this issue and compare the proposed paths, including lib/protocols/incredible.ex, lib/protocols/impl/integer.ex, and lib/protocols/integer_impl.ex. The work is complete only when the project agrees on a convention for protocol definitions and implementations and records it in the style guide.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.