Ad
  • Custom User Avatar

    Yes you are correct, in practice I would not implement it this way, I would probably make it throw, then unit test what happens when the time is improperly formatted. These kata are usually just a quick and dirty MVP solution to the problem, not necessarily production code.

  • Custom User Avatar

    Fair call, you're right. Perhaps the tests should be updated for this particular case.

  • Custom User Avatar

    In general, less code is always better. Less to maintain, less to go wrong. Also, the compiler does some optimisation when it sees these patterns to run them in the most efficient way.

    There are some rare cases where you will need to write optimised code yourself because the compiler doesn't know how to optimise them. One example I can think of is nested loops.

  • Custom User Avatar

    It's included in many of the Linked Lists katas. If you complete them in order it will tell you which katas include previously created functions in the instructions.

    The push() and buildOneTwoThree() functions need not be redefined.