Ad
  • Custom User Avatar

    We're not making arsenals here, we must write a program to do a task. Input validation has been done in many old katas and is now considered a bad practice for the reason I mentionned. Checking the input is a negative number is 8 kyu kata level. It's of course interesting to know how to do that, but mixing this with a totally independent task like finding multiples of a number doesn't bring any value, in real context it'd be better to handle input validation separately from the main algorithm.

  • Custom User Avatar

    honestly i disagree, error checking should be part of any programmer's arsenal, this exactly how security bugs are found. and the lack of such a check has resulted in almost all answers not relating to such a case.

  • Custom User Avatar

    Most languages already do. And better for those that don't, since it doesn't bring any value to the task.

  • Custom User Avatar

    add a negative number check. In other words try the function with -10 or something.