The joy of code katas
Some people are probably familiar with LeetCode as the site where those aspiring to work at FAANG companies practice for their upcoming coding interviews. I recently tried solving some problems on the site and found it really entertaining. Several programming languages are supported and I'm happy that Elixir is one of them. And between visits to the site, I can walk around thinking about how to solve a problem with sufficiently low time complexity.
These types of small programming problems are sometimes called "code katas". The word kata comes from Asian martial arts and refers to small exercises that are repeated over and over again. The idea is that you improve your skills by practicing and repeating the same actions and by building a strong foundation. Not just solving a thing once – but repeatedly doing it.
Speaking of solving small programming problems, this year's edition of Advent of Code will soon start. Its creator has already announced that this year there will only be 12 problems instead of the usual 25, and that there will no longer be a leaderboard. I think 12 problems feels more reasonable and realistic to complete anyways, so for me it only feels like a positive change. Some years I have solved the puzzles during my summer vacation, so the leaderboard isn't something I have ever cared about. In any case, I'm slightly more interested in participating in this year's edition. As usual, it's a great opportunity to test out a new programming language that you might not get to use normally.
What I enjoy about this type of challenge is the problem solving. It's fun to think and test, and it's very satisfying when coming up with a solution. I think LeetCode has done it very well with their site, because they even measure the runtime performance of your algorithm and you can very easily look at more efficient solutions. I'm learning Elixir, and I have picked up on several language features thanks to that feature, that help me write more efficient, idiomatic, readable, and simpler code.
My LeetCode profile can be found at https://leetcode.com/u/DanOpcode, and I'm posting my solutions at https://codeberg.org/DanOpcode/leetcode.
Happy coding!