Ad
  • Custom User Avatar

    I think in programing there are a lot of possible solutions and you can evaluate each of them looking at various aspects.
    This isn't about who has the "best" solution overall. This is about learning that there is always more than one possible solution.
    For me it is essential to always write maintainable code. If you are used to do that in any case, then you will always write maintainable code, especially when it is for production environments.
    Thus, I do not agree, that in terms of clean code the shorter version is better as clean code is a lot about maintainable code.

  • Custom User Avatar

    I agree that this is shorter in terms of line-count, but what about readablity and maintainablity? My personal experience is that more explicit code is easier to read and to understand (in terms of code-maintenance).

  • Custom User Avatar

    I'm a bit confused why the syntax changes compared to the first part. Why have you introduced the commas? Also the change of the function's return type causes that all tests from the first part need to be adapted. The resulting message could have been a special 'msg'-register in the returned dictionary.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution