Skip to content

Suggestion: documenting the (actual, expected) order for all languages #390

Open
@interrupt-routine

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions