Ad
  • Default User Avatar

    I joined Codewars recently. To be honest, it was the first time I learned about Golfing.

    I agree it is fun and it makes you think out of box, however some people may think it is a better way even for production. As you can see Mauro-1's comment: 23-chars solutions are readable and better then ceil.

    The reason why I joined Codewars was to show our new colleague a place where she could train and improve her skills. You all commenters are the top 1% of developers, however there are also people learning how to code. Perhaps it was my wrong assumption that Codewars is a good place where new developers can train their skills?

  • Default User Avatar

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

  • Default User Avatar

    If you comapre how short is your code with someone else then yes, it is fine.

    However this kata is perfect example why Golfing is horrible idea if you maintain code in a team. The team usually doesn't consist of top 1% of world developers. Every average developer reading such code would need to put special effort to understand such piece of code.

  • Default User Avatar

    Easy, just add random tests. Something like this:

    [i * random.randint(2, 3) for i in random.sample(range(1, 100), 10)]
    
  • Default User Avatar

    This should clearly state that Golfing is not recommended for production coding as it makes code less readable.