Improving your programming skills with Codewars

Throwback to January 2016 - it's been about one and a half years since I first learnt how to code websites and simple games using HTML5 + CSS3 + JS thanks to BSD Academy. I would create simple projects every once on a while such as a 60 second multiplication game powered by client-side JS or a simple Merry Christmas webpage with background music, as well as constantly searching the Web for related topics and information. However, despite my ability to create simple projects, my knowledge of algorithms and data structures were next to nothing - I wasn't even aware of basic problem-solving techniques such as recursion or that you could append elements to a JS array using Array.prototype.push!

Then I discovered Codewars. Codewars is a site where programmers can train on programming challenges called Kata once they pass the entrance test (a debugging exercise called "Multiply"). For the first two to three months since I joined Codewars, I was completely addicted to it - I would spend hours on it every single day completing Kata upon Kata as well as authoring my own Kata (Codewars is community-driven; pretty much anyone can create and publish their own Kata for others to complete) whenever I had an idea. As a direct result, I learned a great deal about programming and problem solving in general and handy JavaScript built-ins such as Array.prototype.map, Array.prototype.filter and Array.prototype.reduce within a very short timeframe. Even after those initial two to three months, Codewars continued to be an integral part of my daily routine and I kept on learning new topics such as recursion and linked lists through completing related challenges. Within just half a year of joining Codewars, I went from a complete n00b in problem solving and algorithmic thinking to a "proficient" programmer (defined as in the 1-2 kyu range). So, what advantages does Codewars offer over similar platforms such as CodinGame, Hackerrank and Leetcode?

First of all, the content on Codewars is plentiful and widely varied. Some Kata focus on language-specific features or certain popular frameworks/libraries/etc. such as React. Other Kata may focus on typical Computer Science topics such as linked lists, binary trees, recursion, memoization and compiler theory. Yet other Kata place a strong emphasis on mathematics and formal theorem proving. Even for similar topics, the difficulty of Kata can vary wildly - for example, some math Kata are as simple as "find the sum of the first n natural numbers" (in constant time or otherwise) while others may require you to prove the commutativity of addition of natural numbers (a Kata that I'm currently stuck on) or solve the Fabérge Easter Egg problem in linear time. In contrast, other similar platforms such as Hackerrank or Leetcode may place a stronger emphasis on competitive programming and/or algorithmic thinking.

Another unique feature of Codewars is that it is almost entirely community-driven - any member of the community with sufficient honor points can create their own code challenges (aka Kata) and publish them. The Kata then enters the beta phase where other community members get to try it out, vote on it and provide feedback. Then, if/when the Kata is considered to be of sufficient quality, a moderator (someone automatically assigned the role once he/she reaches a certain honor level) can approve it and the Kata leaves the Beta phase - it officially becomes a Kata on the site that everyone can train on and gain rank progress. In contrast, certain similar platforms may not allow the community to create new content on their site and even other community-driven platforms such as CodinGame may have certain restrictions as to which type of content can be created by the community.

It is also important to note that Codewars uses a highly intuitive format of Test-Driven Development (TDD) which is very similar to what you would see in a workplace. Every Kata starts with an initial solution (some boilerplate code for the solver to get started with) and a set of Sample Test Cases which are assertions written in TDD format using a popular framework such as JUnit for Java or HSpec for Haskell (for most languages anyway, certain languages such as JavaScript use a custom framework instead which is documented on Codewars' GitHub Wiki page). The solver then proceeds to (attempt to) write a working solution that passes these Sample Test Cases. In the process, the solver is allowed to edit these Sample Test Cases to write his/her own assertions, for example. Then, once the solver is confident that he/she has a working solution to said Kata, he/she can click "Attempt" which would run it against a (hidden) test fixture provided by the Kata author. Once the hidden tests are passed, the solver is considered to have passed the Kata and can submit his/her solution to gain rank and honor progress as well as view others' solutions for additional insight. In contrast, platforms such as CodinGame rely entirely on file I/O which is highly unintuitive and platform-dependent.

Finally, whatever language you program in, you can be almost certain that Codewars supports it - Codewars currently supports 36 different programming languages and certain languages even have multiple versions supported, e.g. Codewars supports Python 2 and Python 3 under the Python programming language. In contrast, CodinGame only supports around 25 languages (and that is only after considering Python 2 and Python 3 to be 2 distinct languages), Hackerrank seems to display less than 20 and the only challenge I have attempted on LeetCode (which was on linked lists) provide only C, C++, Java and Python (not even JavaScript!).

In conclusion, Codewars is a great site for programmers of all abilities and backgrounds to train on code challenges and improve their programming skills which also offers multiple advantages over similar (rival) services.

Nice, post . Do you think that codewars will improve your coding abilitys ? Sometimes its taking me 1-2 hours to a solve a single problem , and iam thinkin is that normal ? :) What do you think about it ?

I don't know about other Codewarriors but Codewars has definitely helped me improve my programming ability in more ways than one.

Sometimes its taking me 1-2 hours to a solve a single problem , and iam thinkin is that normal ?

That is very normal indeed, especially if you are attempting a blue/purple Kata (1-4 kyu range). To give you a recent example, the "Scott Encoding" Kata (a 1 kyu Haskell Kata) took me at least 2-3 hours on end to solve. I've also heard cases where codewarriors, even the brightest ones, would spend days on end before figuring out a working solution to a particular Kata.

Thanks for your feedback on using Codewars.
It's great to have it compared with some other alikes.

I discovered Codewars 4 days ago. It has the most original "join in" process I ever seen.
It has also the best concept I can think of to actually get better in a programming language. Much more motivating than coding alone on your computer.
You can start with easy kata first, to learn the basic syntax of the language, and try more challenging ones later on.
The test driven approach is an excellent idea.
Looking at the best practice others have coded after your wrote your own piece of code add so much value.

Learning how to code, or anything else, through Gamification and Socialization is passionating to me !