Skip to content

Kata Solutions & Voting

Jake Hoffner edited this page Aug 17, 2017 · 4 revisions

About Solutions

Each time a warrior completes a kata within a given language, their solution is added to the list of successful solutions for that particular language. After completing a kata you are immediately taken to this page, often giving you an Aha! moment when you realize how others have completed the same task. This moment can be incredibly enlightening if you come across solutions that had a different approach than yours.

Who can see solutions?

Code Warriors are able to view the solutions to a kata under one of the following two conditions:

1. They have completed the kata

Once you have completed all of the tests and submitted your final version, you will be taken to the solutions page.

2. They have forfeited their honor

If you choose to give up on the kata, you can click the "Unlock Solutions" button within the kata trainer. This will forfeit any honor and rank progression that you could earn on the kata. You will then be taken to the solutions page.

Solution Groupings

A basic algorithm is used to try to match new solutions to existing ones, so that the list does not become littered with duplicate solutions. Basic syntax structures, comments and in some cases, alias method names, will be removed so that solutions can be compared.

Voting

Solutions can be up voted by the community. There are two types of voting options: "Best Practices" and "Clever". You are only allowed to vote for one option per each solution.

Best Practices

Best practice solutions are meant to be those that you would expect to see in production code. These are not meant to be overly clever or code golfed (short) solutions - these are solutions that you would be happy to see in the real world. Imagine someone else wrote this code and you had to go in and fix or add to it. Do you want to see hard to read/comprehend solutions or do you want something you can understand?

Best practices should be a good combination of performance, readability and maintainability. They should enforce good coding standards like defensive coding (handling of edge cases).

Clever

This is the vote you are looking for if you see a solution that is code golfed or generally clever in some way. If a solution is both clever and performant, readable and maintainable, then "Best Practices" is the way to go. If it is so clever that you are impressed but too clever that you would want to have to deal with it when fixing someone else's code - then "Clever" should be your vote.

Sample Test Cases

When training on a kata you are giving sample test cases which you are allowed to edit and use at will. These are meant to be used for TDD development. They are not shown within the solutions page so feel free to use this section however you want in order to successfully test the kata.

Clone this wiki locally