Skip to content

Commit f8016bc

Browse files
committed
Describe them as potential anti-patterns
1 parent 82818f7 commit f8016bc

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

lib/elixir/pages/anti-patterns/code-anti-patterns.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Code-related anti-patterns
22

3-
This document outlines anti-patterns related to your code and particular Elixir idioms and features.
3+
This document outlines potential anti-patterns related to your code and particular Elixir idioms and features.
44

55
## Comments
66

@@ -295,6 +295,8 @@ defmodule PlugAuth do
295295
end
296296
```
297297

298+
#### Additional remarks
299+
298300
There are few known exceptions to this anti-pattern:
299301

300302
* [Protocol implementations](`Kernel.defimpl/2`) are, by design, defined under the protocol namespace

lib/elixir/pages/anti-patterns/design-anti-patterns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Design-related anti-patterns
22

3-
This document outlines anti-patterns related to your modules, functions, and the role they
3+
This document outlines potential anti-patterns related to your modules, functions, and the role they
44
play within a codebase.
55

66
## Alternative return types

lib/elixir/pages/anti-patterns/macro-anti-patterns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Meta-programming anti-patterns
22

3-
This document outlines anti-patterns related to meta-programming.
3+
This document outlines potential anti-patterns related to meta-programming.
44

55
## Large code generation by macros
66

lib/elixir/pages/anti-patterns/process-anti-patterns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process-related anti-patterns
22

3-
This document outlines anti-patterns related to processes and process-based abstractions.
3+
This document outlines potential anti-patterns related to processes and process-based abstractions.
44

55
## Code organization by process
66

lib/elixir/pages/anti-patterns/what-anti-patterns.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# What are anti-patterns?
22

3-
Anti-patterns describe common mistakes or indicators of potential problems in code.
3+
Anti-patterns describe common mistakes or indicators of problems in code.
44
They are also known as "code smells".
55

6-
The goal of these guides is to document known anti-patterns found in Elixir software
7-
and teach developers how to identify them and their limitations. If an existing piece
6+
The goal of these guides is to document potential anti-patterns found in Elixir software
7+
and teach developers how to identify them and their pitfalls. If an existing piece
88
of code matches an anti-pattern, it does not mean your code must be rewritten.
9-
No codebase is free of anti-patterns and one should not aim to remove all
10-
anti-patterns of a codebase. The goal is to promote a discussion of potential
11-
pitfalls and provide alternatives into consideration.
9+
Sometimes, even if a snippet matches a potential anti-pattern and its limitations,
10+
it may be the best approach to the problem at hand. No codebase is free of anti-patterns
11+
and one should not aim to remove all of them.
1212

1313
The anti-patterns in these guides are broken into 4 main categories:
1414

@@ -36,6 +36,8 @@ Each anti-pattern is documented using the following structure:
3636
* **Refactoring:** Ways to change your code to improve its qualities. Examples of refactored
3737
code are presented to illustrate these changes.
3838

39+
An additional section with "Additional Remarks" may be provided. Those may include known scenarios where the anti-pattern does not apply.
40+
3941
The initial catalog of anti-patterns was proposed by Lucas Vegi and Marco Tulio Valente, from [ASERG/DCC/UFMG](http://aserg.labsoft.dcc.ufmg.br/). For more info, see [Understanding Code Smells in Elixir Functional Language](https://github.com/lucasvegi/Elixir-Code-Smells/blob/main/etc/2023-emse-code-smells-elixir.pdf) and [the associated code repository](https://github.com/lucasvegi/Elixir-Code-Smells).
4042

4143
Additionally, the Security Working Group of the [Erlang Ecosystem Foundation](https://erlef.github.io/security-wg/) publishes [documents with security resources and best-practices of both Erlang and Elixir, including detailed guides for web applications](https://erlef.github.io/security-wg/).

0 commit comments

Comments
 (0)