Ad
  • Custom User Avatar

    I just wanted to do this without modulo. Lmao

  • Custom User Avatar

    Thanks. Though I haven't updated this kata I feel I feel should mention that I created it before const and let were a part of JS. :)

  • Custom User Avatar

    Alright - I'd be willing to bet $100 that if you put my solution in front of a developer of any experience level, 99% of the time they would instantly be able to understand what is going on. The same cannot be said for the most popular solution for this kata without having to learn what is essentially another language. Your argument is essentially "to understand this solution, you need to understand this solution", which is even more moot than yours... I'm giggling to myself a little because you're trying to call me out for not knowing a language I have already admitted to not having learnt at the time. You could write the solution in base64 for god's sake, but if you didn't know what base64 was or how to understand/read it, you're not going to have a solution that is understandable by the majority.

    tl;dr Nice strawman argument, my solution is understood at any skill level.

  • Custom User Avatar

    To be honest, when I made this solution, I wasn't all that great with Regex, so I opted to go for readability. I'd posit this way is much easier to grok at a glance and causes less mental load than having to untangle a regex in your head if the author didn't choose to leave a comment explaining what its purpose was.

    I'll hold my hands up and say your second point is completely valid, though.