Codewars – Gamify Daily Programming Practice
I don’t get to use Python very often in work unfortunately, and while I do create regular scripts for home automation tasks, there’s often weeks in-between those projects.
I’ve found myself getting into a cycle of heavy Python coding when working on a project, not touching Python for weeks once it’s complete, and then having to revise books/tutorials to get back up to scratch for the next project.
The key to retaining any kind of technical knowledge is to use it as often as possible, preferably daily. Which is why I’m really enjoying Codewars.
Codewars is basically a “gamified” daily coding challenge, wrapped up in a martial arts progression theme. You progress through “Kyu” ranks by completing “Katas” for XP. The Katas are challenges created by the community, ranked by difficulty, with the high ranked Katas giving you more XP. The list of languages is extensive, even including the likes of COBOL, Fortran and PowerShell, and you’re free to select as many as you like, retaining a separate Kyu ranking for each.
The Katas range in the simplistic (get the mean of an array) to what I would consider completely beyond my skill level (write a three-pass compiler).
In-between are all types of challenges, both in terms of your programming knowledge and problem solving skills. There’s an extensive tagging system, if for example you fancy brushing up on your knowledge of Strings.
To pass each Kata, you run your code against a number of tests, all of which must succeed for you to complete the Kata and gain XP. There’s an in-built code editor, although I find it easier to work on an external editor and paste my code in once I’m happy with it. There’s a pre and post solution discussion board for each Kata; the site does a good job of hiding “spoilers” that might inadvertently help you complete the Kata, although I find it’s best to avoid the pre-solution discussion altogether if you want true satisfaction in achieving the solution yourself.
While the whole progression and levelling system is great, what I really love about Codewars is the ability to compare your solution to other Codewars users. Codewars has a very neat feature that groups similar solutions into one, with users voting on these solutions in terms of best practices, age, and even how “clever” it is.
It’s somewhat of a double edged sword; the satisfaction of passing the Kata and receiving the XP (maybe even ranking up), only to find that your solution is an embarrassingly long mess of spaghetti code when compared to the short, smart, elegant top-rated solution. A common occurrence for me is to write my solution in 10-20 lines of code, only to find the top rated solution containing 1-2 lines…
I’m trying to do a daily Kata, although unfortunately there’s no “Daily Streak” feature to encourage this, which I think would be a nice addition. I highly recommend Codewars if you need a little encouragement to practice your Python skills daily.