In elixir, one could define the "sum" function in two different ways:

```
def sum, do: 0
def sum(a), do: a
def sum(a, b), do: a + b
def sum(a, b, c), do: a + b + c

```

or

```
def sum() do 0 end
def sum(a) do a end
def sum(a,b) do a + b end
def sum(a,b,c) do a + b+ c end

```

I can even mix the two approaches:

```
def sum() do 0 end
def sum(a) do a end
def sum(a,b) do a + b end
def sum(a,b,c), do: a + b + c

```

My questions are: Why are there two ways of achieving the same? Is the second one preferred in the case of inline functions? What are the advantages of either of them?

Thanks in advance!