About elixirgolf
Elixir golf is all about using Elixir to solve programming puzzles in as few characters as possible. The term code golf was popularised in the 1990s when Perl was used to write a program to do RSA encryption. Since then many different languages have adopted the *Golf challenges. e.g. Perl Golf, Ruby Golf, etc.
The term “code golf” is derived, from the way conventional golf is scored, i.e. the person with the lowest score wins.
Rules
- Only Elixir language can be used, however this also includes the Elixir Erlang syntax e.g.
:binary.copy
. - No requiring third party libraries
- Whitespace is counted
- Metaprogramming is allowed
- No hard-coding return values
Advantages
- It improves your understanding of the language, and how to “think” in it.
- Cudos for ingenious solutions.
- Makes you appreciate writing and reading succinct code.
- Opens your mind to different programming techniques.
- It encourages lateral thinking.
- It’s fun!
Disadvantages
- The code becomes difficult to read and understand
- It is very difficult to maintain code written in this style.
Resources
- Wikipedia on Code Golf: https://en.wikipedia.org/wiki/Code_golf