Ad
  • Custom User Avatar

    @lucas456645 did you even read what Clever means there?

    Vote this solution as being clever. Clever solutions tend to be very creative or make use of obscure language features. They usually are not code that you would want to put into production.

  • Custom User Avatar

    52 people have literally marked it as "clever"

    53 now

  • Default User Avatar

    Yeah, I see your solution, I guess if you work hard for the next 15 years you will see why those 52 people had that opinion. Good look!

  • Default User Avatar

    Well, the solution was not meant to be "clever" (whatever you might think that is), it was meant to work, whick it does. If you don't see what's going on by just looking at it, don't assume any other dev will struggle the same way.

  • Default User Avatar

    Hey, don't blame the solution if you are not smart enough to understand it lol

  • 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.