Code-related anti-patterns — Elixir v1.18.0-dev
View Source
Code-related anti-patterns
This document outlines potential anti-patterns related to your code and particular Elixir idioms and features.
ProblemWhen you overuse comments or comment self-explanatory code, it can have the effect of making code less readable.Example# Returns the Unix timestamp of 5 minutes from the current time
defp unix_five_min_from_now do
# Get the current time
now = DateTime.utc_now()
# Convert it to a Unix timestamp
unix_now = DateTime.to_unix(now, :second)
# Add ...
Read more at hexdocs.pm