Ad
  • Custom User Avatar

    There's a few things that might clarify this.

    1. Clearly written tests
    2. Breaking this up into steps (imperative) and aliasing the output at each step by using constants
    3. Having a clear function name to detail what this is actually doing (this is down to the challenge designer)
    4. Making the map anonymous function a named function to communicate what it's doing

    I guess it's a question of how developers treat these challenges and programming styles. I have been on teams where functional code clearly written, named and tested still throws developers because the style is very different from the imperative style.

    | Someone will come back to this in 6 months and not have any idea what it is doing

    Yeah, probably this will happen with a junior. Without any of the improvements suggested.