Draft

//

Description
Loading description...
  • Please sign in or sign up to leave a comment.
  • JohanWiltink Avatar
    • Use appropriate datatypes.

    String is almost never a good way to tuple up values, and it isn't here. (Int,Bool) ( encoded as an Array, because JS doesn't have tuples ) would be appropriate.

    • Ask for consistent return datatypes.

    Stringifying things does not mean you are now suddenly asking for consistent ones. You should have asked for (Int,Bool), and that can never express the condition that there is no answer that fits that pattern. Expecting an Error to be thrown, or maybe expecting [], null or undefined ( though there are people with whom those choices will also get you in hot water ) would have been better. I think Error is best, but I'd say an empty value like one of the other three is marginally acceptable. ( It would be a ++Good Thing if you could explain the differences between them in the context of this kata, were you to use any of them. )

    Both point are largely academic IMO. I don't think the kata offers sufficient novelty and interest to invest time in fixing it. Everything that this kata is asking for has been done ( and arbitrarily combining unrelated tasks is not a good thing either ).

    Minor point: JS by convention uses camelCase ( except for constants and constructors ). "LCN" should have been "lcn" by that standard. Please adhere to this convention.

    • FurgieWurgie Avatar

      Thanks for the tips :)

    • JohanWiltink Avatar

      You're welcome. Also, do not hesitate to use available resources ( there's a whole gitter channel specifically for it ) when authoring kata.

      Appropriate datatypes can be an advanced topic, with conflicting opinions, all of them including mine wrong, of course. :P You can ask for advice even before publishing a kata! ( The docs actually recommend this. )

  • FurgieWurgie Avatar

    Please let me know if the discription is clear! :)