7 kyu

Player Contact Manager

500 of 962IanEarley
Description
Loading description...
Arrays
  • Please sign in or sign up to leave a comment.
  • mohdmujtabaa Avatar

    Nice kata! Thanks to everyone who contributed to it.

  • FArekkusu Avatar

    JavaScript translation. Please, review and approve.

    • IanEarley Avatar

      Added :)

      Suggestion marked resolved by IanEarley 7 years ago
    • JohanWiltink Avatar

      What is the sense of passing null instead of an empty string? If anything, the function should be called as playerManager(), which would more or less pass undefined, not null.

      Passing null is an inappropriate construct from a different language ( C and friends seem to pass null pointers this way. it makes no sense in JavaScript though ).

    • Voile Avatar

      The semantic of undefined in JS means nothing is even passed (judging from how it usually appears and how it interacts with other language features). null in typed language (especially OOP languages) usually means bottom. So it really depends on what this input validation is even supposed to mean. Is the input not provided, or is it a bottom that is created by the caller's code?

      Also, empty string results in empty array is the natural behaviour, I'm not sure why it's mentioned in the first place.

  • anter69 Avatar

    Python translation kumited -- please check and approve

  • FArekkusu Avatar

    The whole test suite is rubbish:

    • each test expects its own test input, therefore you can return anything to pass
    • first fixed test is wrong
    • first random test is not random
    • other random tests are not generated at all
  • anter69 Avatar

    Use Test.assert_equals instead of Test.expect (otherwise this happens)

    I also suggest to add more random tests (e.g. 50) and make them more random (random number of entries)

    [edit] see python translation for a better test suite

    • IanEarley Avatar

      I see, sorry I'm still somewhat new and this is my first kata so any feedback is good feedback!

      Thanks for the suggestions, I'll make the changes to the test cases!

      Issue marked resolved by IanEarley 7 years ago
  • Voile Avatar

    Sample tests: it's Test.assert_equals, not Test.assert_equal.