7 kyu

Guava against Million dollar error

130 of 131Javatlacati
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Unnamed Avatar

    Are the arguments guaranteed to not be NaN? Some solutions return NaN now, while others throw an exception.

  • dinglemouse Avatar

    if this is the case then throw IllegalArgumentException

    Should say if this is NOT the case...

  • Unnamed Avatar

    zeroTest doesn't expect an exception. The exception message for zero isn't specified.

    • Voile Avatar

      Fixed the requirement, now it is a bit different so every earlier solution will become invalid.

      Also clarified that the checks should done in order and what to do when both numbers are non-positive.

      Issue marked resolved by Voile 7 years ago
  • Voile Avatar

    Approved ;-)

    • Javatlacati Avatar

      thank you sir

    • dinglemouse Avatar

      Well,now there are a whole lot of newly introduced issues.

      @Voile - this should never have been approved until at least your own was valid

    • Voile Avatar

      @dinglemouse: Well, the (used to be) new author requirement was flawed anyway so I revamped it. It took like less than 15 minutes.

      Also, I rely on CW being agile and believe that kata authors are smart enough when they make fixes that they won't screw it up big. Anyways, the fix is done 8 hours after approval, which 7 of them was me sleeping, waking up and transiting to work place, and an 8 hour fix is pretty quick considering how long most common fixes are done; Rather it's more like lots of us are being too active and actually pointed at the issues in an hour of so, instead of not pointing them and just press the very satisfied button (see: Base91 kata?). So all in all it just shows that CW is working as intended. Seems that you're the impatient one here ;-)

  • Voile Avatar

    Okay, so you told us to check that parameters are not null and parameters are positive, but what should we do if they're not? I only found that you expect us to throw NullPointerException for the former after looking at the sample tests (and IllegalArgumentException for the latter after bumping against the actual tests).

    The thing that we should do if input validation failed should be put in the descriptions.

    (Also, note that you haven't enforced the use of com.google.common.base.Preconditions, so the above applies. For people who're implementing this manually, they need to know the expected exception.)

    • Javatlacati Avatar

      All of the issues seem to have been fixed. Thank you for your time, please try again. I will not enforce the use of any library so others can know the equivalent; also is some sort of language philosophy that you should learn to do all manually and by this being ready to take full advantage of framewoks, libaries and tools.

      Issue marked resolved by Javatlacati 7 years ago
  • dinglemouse Avatar

    To avoid confusion maybe that parameters are positive maybe should say do you really want > 0 or >= 0

    As there is no test case for 0 so either currently works...

  • dinglemouse Avatar

    Nice idea to introduce Guava :-)

    • The test case names like testGreet... have no meaning
    • typo in description: fight agains
    • PS: pre-release I'll improve tests later IYKWIM - You risk getting lots of issues and a low satisfaction score with this approach. Really you should get the Kata to a publishable state, and only THEN publish it.