Two ways CodeWars trumps HackerRank

Jessica YungUncategorizedLeave a Comment

Disclaimer: I am a fan of HackerRank’s contests and wide range of problems across languages and domains. Here I discuss two ways CodeWars is better than HackerRank. (Both are sites where you can do programming problems competitively.)

Theme: CodeWars is better for beginner – intermediate learning.

  1. CodeWars emphasises testing throughout.

    1. While you’re working on the problem, there is a code window dedicated to testing. It includes several basic test cases which are especially useful for users who are just starting out or who are not familiar with testing or test-driven development.
    2. screenshot.png
    3. CodeWars shows you which test cases you failed and how you failed. This makes it easier to pass the tests. This arguably makes it too easy because you can see exactly how your code fails, but I think it’s good for learners who otherwise might just give up.
    4. HackerRank gives testing more of a back seat. It usually only shows you one basic test case and does not make it easy to see which real test cases you failed and how you failed them in the window. It is also more of a hassle to upload your own test cases.
    5. In CodeWars, you can also refactor (improve) your code once you’ve passed all the test cases before you make your final submission. So you can check if your brute force version passes all the tests before making it prettier.
    6. Your prettier answer is then made public for everyone to see and up-vote. This is fantastic because everyone gets to see the best answers.
  2. Codewars encourages you to learn from other users’ answers.

    1. CodeWars shows you others’ up-voted clean and clever answers after completing each challenge (Kata) so you can immediately learn from the best answers. On HackerRank people’s answers are not shared unless they post them in the Discussions section.
    2. screenshot 2.png
    3. I learned more from examining a few good examples than from reading online tutorials. It’s especially effective when you compare others’ answers to your own and pick out how your answer is worse (or better).

Links to each site: CodeWars and HackerRank

Leave a Reply