Ad
  • Custom User Avatar

    I disagree. The fact that the kata is easy is not an excuse to make weak tests.

    Okay, that's a personal opinion there. I wrote the original kata 9 years ago and when you look at the JavaScript reference, you'll notice that it doesn't even have a random test. And it still got approved back then (probably by jhoffner himself) and nobody complained :)

    And btw. I'm not in the situation where I'm looking for an excuse. I don't need excuses. I'm simply convinced, that we should be more relaxed in regards to the requirements of katas and translations. If someone really wants to cheat to get into top highscores, there are ways to get there. And running more random tests won't prevent that. If someone is just here to have fun and learn, then in many katas we wouldn't need any random tests at all.

    Btw. as you might have seen, I already published improvements to the tests, because I liked the idea about mixing successful and error cases.

  • Custom User Avatar

    When returning an error from a function with multiple return values, idiomatic Go code also will set each non-error value to a zero value

    source: https://www.digitalocean.com/community/tutorials/handling-errors-in-go

    There might be a few exceptions to this rule, but usually when the error indicates that you can't rely on the other values, you make them empty. In this case there is no way to return a useful amount of reindeers, therefore it's good practice to return 0.

    Mixing valid and invalid tests sounds like a good idea 👍 I'm not sure about the required amount of tests though. Yes, you could run hundreds of tests, but hardcoding those return values and/or having enough luck to pass the random tests requires more effort already than simply solving the kata.

  • Custom User Avatar

    Yes, not sure exactly when. But somewhen this week would be doable

  • Custom User Avatar

    The task was to wrap a function, so that its return values are cached and the wrapped function only needs to be executed once for the same parameters. In my opinion, this was also reflected in the kata description.

    Caching function results is a good practice - independent of the used language - when dealing with slow computations (complex algorithms, external network requests, slow filesystem usage, etc.);

  • Custom User Avatar

    So, if we wanted to have a "fair" bigint kata, we would prefer to create a duplicate of this and assign a lower rank? Because in my opinion this kata is still a good excercise.

  • Custom User Avatar

    You mean, exactly like it's done with JavaScript?

  • Custom User Avatar

    But you still solved it using JavaScript, so it can't be that bad? :)

  • Custom User Avatar

    I've decided for myself to keep both for mentioned reason

  • Custom User Avatar

    Yes, it is possible: you can expand the test cases at the top. Yes, they might all be marked as successful, even when they actually failed :/

    But there you see first the complete result of your query. And below that you can compare your result with the expected one, including a diff.

    This is not very intuitive, but without building an own SQL helper, it seems impossible to change that behavior.

  • Custom User Avatar

    Thanks for this suggestion, I added the detail to the task as well

  • Custom User Avatar

    I guess, it depends on the way you solve the problem. Usually having to deal with two fixed things is easier to implement than dealing with any amount of things.

    But when I look at your submissions, I can see what you're referring to. I'm undecided, I personally would think, it still makes sense to have both katas 🤔

  • Custom User Avatar

    You're saying:

    I've found a case not covered with tests, string "ten million ...

    And the description says:

    The maximum number, which must be supported is 1 million (inclusively)

    I don't see an issue with the tests

  • Custom User Avatar

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

  • Custom User Avatar

    Did you modify the input? Because the pasted one is not the original test data.

  • Custom User Avatar

    If it would start at 12:15, then a 90-minute meeting would take until 13:45, which does not fit into A's schedule.

  • Loading more items...