Description
This applies to all languages for which the test framework boils down to functions in the form : assert_equal(actual, expected)
.
For some languages (e.g. Python, JS, C ...) the order is (actual, expected)
, for some others (Java, C# ...) the order is (expected, actual)
. This results in a lot of mistakes; issues complaining that "actual and expected are flipped" are widespread.
It is hard to remember the order for the dozens of languages that codewars support, especially when trying to fix issues in a language with which one is not familiar.
My suggestion is to add a page in the codewars docs that would contain a table listing the parameters' order for each language to which it applies, so that it can be checked quickly.
For example something like this:
Language | Parameters order |
---|---|
C | (actual, expected) |
C# | (expected, actual) |
JavaScript | (actual, expected) |
Java | (expected, actual) |
Python | (actual, expected) |
Alternatively, this could be added on a per-language basis on each language's doc page.
Activity