Coding, like any other skill, needs constant improvement, time investment, commitment and honing. Regardless of the knowledge level you’re at, if you don’t practice, your performance in the field will degrade because we humans tend to forget things we don’t repeat, and even if that’s not the case, your competition is certainly doing it, so you are forced to do it in order to keep the pace. While there are many ways to practice coding, one of the best ways is to do something that is:
- fun,
- instantly verifiable and comparable,
- motivating to endure and to keep coming back.
Since the coding produces an immaterial output, it is perfect for collaboration, contemplating, sharing and discussing on the Internet. During the last 10-15 years, great online learning and collaboration communities emerged which simplified many of the aspects of dealing with the code, starting from learning, exchanging ideas, collaborating on projects and many more useful things.
Figure 1: Codewars.com screenshot
Codewars platform
From the official documentation, Codewars is a “platform that helps you learn, train, and improve your coding skills by solving programming tasks of many types and difficulty levels”. It has elements of a social network because every user gets its user account with viewable code rank, can contact other users and collaborate with them, even can directly compete, solving some particular problem against the opponent. The core material of the platform is some 8000 coding challenges ranked by various criteria, of which probably the most important is the level of complexity. The user solves the challenges and gets rewarding points for every solved problem. Users are then ranked to each other by total number of points and is clearly visible how one stacks up against others. Solutions of the particular problem are not visible until user solves problem (although user can ‘unlock’ the solution and see the solutions forgoing at the same time the reward points). The harder the problem solved, more points are gained and the rank being higher and faster achieved. Users can also submit their own problems, which includes writing test cases for them, discussing solutions, contributing to code sharing platforms like GitHub, and much more.
Figure 2: Screenshot of my Codewars profile
Pros
It is all about algorithms and data structures.
Down to the core, coding is resourceful using of various algorithms and appropriate data structures. Reading the theory or watching live or video presentations of others explaining it is certainly good but not good enough to master the skill. Only when you do it itself through repeating, trial and error and correcting your mistakes you will progress. So, when user solves a particular challenge on Codewars he/she can’t see the solutions: in order to gain the points, user must successfully pass the tests which is considered the solving of the problem. Problems may range in complexity, but they all include using one or more algorithms, loops, conditional statements, maybe recursion, regex and so on. In fact, you are free to use whatever you want from the toolbox of the particular programming language in order to pass the tests. When it comes to data structures, you’ll obviously use everything that can solve the problem, including arrays, lists, dictionaries, maps, sets and whatever not. You will perform conversions of various data types, transform data structures, manipulate them in resourceful ways and you will learn A LOT about structures’ mutability, data types, possible uses and limitations, best practices, fastest algorithms and much more. That is true for the more advanced developers as well: regardless of the knowledge you may already possess, you WILL be challenged (Bjarne Stroustrup excluded).
Very important feature of Codewars is seeing other people’s solutions. This is BIG, as through reading and analyzing code others have written you will IMENSELY learn. I often found myself in the situation of solving particular problem in a certain way which was at the moment maybe less sound to me, but unable to solve it using the preferred logic. After submitting, I skimmed through the others’ solutions and found the way to solve the challenge in a way that I wanted to. Reading solutions helps VERY MUCH because in you realize that a particular challenge can be solved in a wide variety of ways which opens doors to a new knowledge and points you in the directions you thought prior were impossible.
Testing comes as a part of the package
As every challenge includes a number of tests to check the solution for, you will soon realize that your code needs to pass every included test. If you want to write/submit your own challenges, you will have to include tests as well. Therefore, your understanding about the designing and usage of tests will skyrocket, as you will see various examples of test cases, how they’re structured, for what particular case they are testing and so on. A software testing is very sought skill on the market so by doing these challenges you will advance in that field as well.
Importance of trial&error
I would argue the attempts and failures in the process of solving something are the most important way of learning anything. Because of abundance of rules, you will fail often. It will surely be frustrating, but through every single fail you will learn, explore the issue, eventually figure out your mistakes and use that knowledge in the next iteration in you favor. You can’t learn to code only by passive engagement (for instance reading a book); that surely helps but does not provide the possibility for an user to actively solve a problem. Active engagement is the way to go, because only by example that YOU have to approach to, your mind starts actually to work, to think about the underlying knowledge and possible solutions. Codewars and similar platforms shine in this regard.
Easily-verifiable challenges will activate your logic (thinking and reasoning) brain region(s)
This obviously counts for every kind of a challenge, but even more if the challenges can be verifiable. For instance, if you have tried to challenge yourself by reading some algebra book and solving some problem found there, you could end up breaking your brain without any incentive on how actually to check where/why your incorrect solution is wrong. I am NOT saying coding challenges are comparable in some particular way to the mathematical ones, but they are certainly MUCH MORE EASILY verifiable: enter the code, click test, tests are run and you instantly get the results. If they are incorrect, you may rearrange your code to display that key variable, or even using an IDE to visualize the execution of your code. Of course, you’d do the same for mathematical problems using some computational technique (MATLAB or similar), which boils down again to verification through executing computer code. If you know you can easily evaluate your solution, you know your hardship will not be in vain as you WILL get the feedback which can gradually point you to the right direction in thinking and ultimately finding a correct solution. On a numerous occasion I caught my brain doing the problem-cracking in unexpected times, for instance during the night: subconscious being activated and pointed in the right direction (although I may stand corrected on that assertion but certainly it seems so to me).
Persistence through healthy addiction
Many say that the key to the success in every field is persistence in doing hard things. But hard does need to be boring at the same time. In fact, if we trick the brain to do the hard things in a fun way, it could be very appealing to us. Codewars achieves that, at least for me: it creates a healthy addiction of solving challenges often and on persistent basis. Firstly, everything runs in the browser, you don’t need to install anything, so you can use it everywhere. Secondly, you are being constantly challenged; since we are naturally curious, you ask yourself what awaits you next. Thirdly, you are starting to advance the concepts and to gain new knowledge, so in connection to the second point, you can always expect to learn something new. So, it creates a new habit, which is for coding enthusiast more valuable and fun than, say, watching TV (which may be occasionally fun but at least for me totally unproductive).
Cons
Lacking big picture
Algorithms and data structures are only an important but rather small subset of programming, or even taken broader, computer science. There are A LOT of equally important or very important things to fit the big picture in, like databases, software version control systems, GUI design, simulations, networking and system administration, cyber-security and encryption, design of systems, OOP and other programming paradigms, etc. Being good at algorithms and data structures is required, but far from being the ONLY condition for a professional developer. Even programmers with a broad range of technical know-how need to have some decent amount of interhuman and personal skills. Being stuck in a basement doing only coding challenges will NOT get you there.
Miscellaneous
I have one technical issue with Codewars: only basic tests are freely accessible. User can’t see additional tests which can be sometimes important, particularly when solving more advanced challenges. It is frustrating not to be able to see the test you’ve failed.
My experience
In a matter of a couple of months, I’ve solved 100 challenges, ranging in complexity from easy to middle ones. I used C# and Python, which are the languages I’m at the moment particularly interested for. Overall, I am satisfied with the results and plan to use the site in the future as well. My biggest gain was the persistence in the coding practice, which I couldn’t get from other sources.
Conclusion
In this article I elaborated on the reasons pro et contra to usage of competitive coding platform Codewars. I liked the experience and its features, at the same time being aware that coding is much more than solving prefabricated problems. Like with any other field, it is the balanced approach that is the most fruit-bearing, so be sure to complement coding challenges to research of other topics computer science consists of.