Ad
  • Custom User Avatar

    used almost the same method, nice though)

  • Custom User Avatar

    This is actually an issue, raised 8 years later :-)

  • Custom User Avatar

    Sample and fixed tests such as 0.23 and 0.785 should be added across all languages to invalidate such solutions

  • Custom User Avatar

    Description should be language-agnostic

  • Custom User Avatar

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

  • Custom User Avatar

    Uh sorry for not answering, but yes, I've seen your proposal. I wanted to create a fork to test it out but got busy and never got back to the topic.

    It would be cool if oyu could at leat create a fork to test the approach, or even fix the issue right away. If you can't then I will, but I do not know exactly when. I have the issue in my backlog nonetheless.

  • Custom User Avatar

    @hobovsky did you see this?

  • Custom User Avatar

    Well, the docs are very clear when it comes to explaining the raise keyword. This is the standard, most acceptable way of reporting that something went wrong in the code. What would you suggest instead?

    I'm not trying to sound condescending (and I hope I'm not being toxic here!), but I don't understand how you could possibly use try here.

  • Custom User Avatar

    Thanks. I do know about documentation. Please, take trouble and read it (your link). From the first page you've got try:/except: examples of raising ValueError. What I suggested, might improve this kata and Codewars in general. If there would be less trouble with single instances (katas), the better resourse it would be. Yours (1 kyu rating) is not for being toxic, right? :-)

  • Custom User Avatar

    Not a lot better but, what about this?

      it("Test zero", function() {
        assert.ifError(circleArea(0));
        assert.throws(() => circleArea(0), Error);
      });
    

    That shows this error:

    Error: the string "Error" was thrown, throw an Error :)
    
  • Custom User Avatar

    I noticed this but I have no good idea how to prevent this. The crappy message comes from Chai :( I will try to figure something out, maybe craft my own assertion.

  • Custom User Avatar

    Searching for 'raising ValueError' and code skills previously learned lead people to try:/except: solutions.

    There's the official documentation you know...

  • Custom User Avatar

    OK. Not everyone (1 dan) yet here. Searching for 'raising ValueError' and code skills previously learned lead people to try:/except: solutions. None of which, obviously, works.
    And these katas are for codders who are not expert-super-duper pros. They are for novices. That is why a helpful hint in description of the kata, or a hint in test evaluation would be much appreciated by them. To that, I admit, that I confused "raising an error" with "handling an error". Now will remember the difference. Thanks.

  • Default User Avatar

    rejected by someone, and the author closed their account

  • Custom User Avatar

    but... what are the "another methods of raising ValueError"? You confused "raising an error" with "handling an error" - try:/except: is used to handle errors raised by someone, somewhere, and not to raise errors. The description asks users to raise an error and not to handle an error, and this should be enough of an explanation that try/except in your solution is not needed. How would I have to change the tests or description to help with such confusion?

  • Loading more items...