Do & Don’t — Length of Range — Elixir
2 min readDec 18, 2018
Calculating the length of range
iex> range = 1..100000000
DON’T ❌
iex> range |> Enum.to_list |> length
100000000
It takes a few seconds to give you the result and it’s a bad idea.
DO ✔️
The following code statements would results in no time.