DEV Community

Donald Sebastian Leung
Donald Sebastian Leung

Posted on

 

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.

Top comments (11)

Collapse
 
clickys profile image
Clickys

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 ?

Collapse
 
donaldsebleung profile image
Donald Sebastian Leung

Do you think that codewars will improve your coding abilitys ?

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.

Collapse
 
clickys profile image
Clickys

i will def then do it on a regular basis to improve my programming logic and skills.

Collapse
 
yoric profile image
Yoric

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 !

Collapse
 
donaldsebleung profile image
Donald Sebastian Leung

Thanks for your feedback, glad to hear you're enjoying Codewars too <3

Collapse
 
waynee95 profile image
waynee95

I have been doing Katas on codewars for quite a while now. I don't do them everyday though. But I think it's a really nice way to improve your problem solving and algorithm skills.

I am not sure if I should be more strict on when to use google to help me find a solution, since usually one learns a lot when you just sit down and work a problem. Even if you don't get it right, you will learn from the errors on your way. Sometimes I end up googling either for documentation (when I don't quite remember the name of a function or a certain concept), but sometimes you will stumble across the solution to the problem too easily.

Another cool thing is the community-driven aspect you also talked about. It's really cool that you can compare your solution immediately after you submitted it.

The only thing that really bothers me about codewars is the really slow loading times. I don't think that is related to my connection though, since I have seen quite a few people reporting that. And maybe sometimes the problem lacks a bit in description or test cases.

However, I can really recommend codewars. It's fun!

Collapse
 
pbouillon profile image
Pierre Bouillon

I discovered codewars only a couple of days ago but I find this site pretty slow.. may be my connection tho.

I really like codesignal too, give it a shot someday !

Collapse
 
donaldsebleung profile image
Donald Sebastian Leung • Edited

I really like codesignal too, give it a shot someday !

Thanks for the recommendation, I'll give it a try someday :)

Collapse
 
jacobjzhang profile image
Jake Z.

Awesome post! Super useful analysis of a very useful site.

Collapse
 
lookfishy profile image
Atif Bhai

Thanks for sharing these improvements in coding skills. cdhpl.com

Collapse
 
rnrnshn profile image
Olimpio

What you do when you find a certain problem that you don't know how to solve it?

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.