Ad
  • Default User Avatar

    Hi,

    Yes, I think it's a good idea to use functions from a language's "standard library" whenever possible in order to avoid mistakes, performance issues etc. Once you learn them you can also save time and communicate better with other people who are familiar with them.

    I believe the code in our solution is more readable, more concise and less error-prone. Notice you can read it almost as an English sentence, compared to low-level "mathematical" language in your solution. It becomes important when you read and maintain a large code base.

    In summary, it's a good idea to operate on a high level of abstraction. Think about higher-order functions in functional programming or classes with their public methods in object-oriented programming.