Max Kuderko
1 min readFeb 3, 2021

--

Please note that the code written in Go does more than the elixir one (print the success as well as error, elixir does not print it, and elixir code panics on an unhandled error like you said which is a bad "production" error handling) also the best practice in go or ant other language for that matter is to keep the happy path in the root of the function so a comparable example would look something like this:

c, err := foo.Client()

if err != nil {

panic(err)

}

msg, err := c.Request(foo, bar)

if err != nil {

panic(err)

}

(you could also provide a full elixir example with tdout prints)

so not that significantly different.

The issue IMO between elixir and Go is not syntax... its performance, community support & tooling

basically speaking the Foo.client() will be opensource and maintained in go eco system and non existent or neglected in elixir.

the code will run slower requiring much more CPU * memory resource (just checkout techempowered benchmarks)

and in the end they are very different languages meant for very different problems.

--

--

Max Kuderko
Max Kuderko

No responses yet