I am beginner who thought before doing the String Methods section of the course “You know what, let’s test my skills”. And boy my skills were tested. After I completed the challenge my jaw dropped, with the solution.

Had/Have this happened to y’all. Where you make something complicated and found out that there was a simple solution?

Solution

My Code

  • annoyed-onion@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    10 months ago

    All the time and I’ve been programming professionally for 10+ years.

    You’ll always find a better way to do something, however, there’s nothing wrong with what you initially came up with as it’s easy enough to understand because you’ve named your variables well and your logic is easy to follow along with. I would say that is far more important than coming up with technically clever solution that may be harder for someone else to understand!

      • Kevin@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        From a maintainability standpoint, absolutely. Computers have gotten fast enough to let programmers optimize for developer time instead