Ad
  • Custom User Avatar

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

  • Custom User Avatar

    how does it work? Any documentation that support this assumtion... =)

  • Custom User Avatar

    You are right, and sometimes the shortest code is also the best, depending on language ie Haskell, JS Java C# F#, if it is short because it is coded functionally, or with nice comprehensions in python. not always just depends

  • Custom User Avatar

    To be fair, the never-lasting debate about "what is best practice" happens because best practice can be many different things (same to clever):

    • Fastest code
    • Shortest code
    • Best algorithm
    • Cleanest code
    • Most informative code
    • Most thorough code
    • ...

    It's kinda like you're in Oscar and there's only a "Movie of the Year" category. Of course everyone will argue about its all-encompassing nature.

    The way to go is, of course, split it into those categories and rank by there. But then it (probably) becomes too complicated for everyone. So I guess we're stuck at now.

  • Custom User Avatar

    There are many dirty tricks to make your code execution faster. Most of which you will never use in production code. People will start upvoting fastest answers as "Best Practice" and people who learn to code will pick up some bad habbits. The only thing that could work is a special category of katas, purposely curated for execution time optimizations with solutions showed from fastest to slowest.

  • Custom User Avatar

    > implying shortest code is never also the fastest code
    > implying fastest code = best code

    Okay, let's switch to micro-optimizations then?

  • Custom User Avatar

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

  • Custom User Avatar

    Duration of execution is a criteria but this shouldn't be THE criteria to determine the best solution. The best solution should be a fine balance between complexity(related to execution time), readability and best practice.

  • Custom User Avatar

    "They said it before, and we'll say it again..."

    Add my vote also for a parallel "time to run" score! :D

    Possibly this could lead to excessive re-running of solutions to get a lucky fast score. So maybe limit the publicable time-to-rum score just to a user's first successful solution for a given kata, or something like that?

  • Custom User Avatar

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

  • Custom User Avatar

    The items in the array may also be null values. Your code uses if (x) but you need to have a null check inside the for loop to check if the current value is a null value.

  • Custom User Avatar

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

  • Custom User Avatar

    But 10 votes and all >=5;-)... The ranking is not always a sign to be able to solve the kata. Sometimes/often it depends on the content too - nobody is able to solve every kata (ok... i'm the exception:-P... hey, it's just fun...)!

  • Custom User Avatar

    The grading is down to warriors who complete the Kata while in beta. I personally think it should be a 4KYU because there is a Kata very simular to this that is at that grading. Sorry

  • Custom User Avatar

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

  • Loading more items...