Retired

Bugfixing: Swap values (retired)

Description
Loading description...
Algorithms
Bugs
  • Please sign in or sign up to leave a comment.
  • Clarity Avatar

    This comment has been hidden.

  • FArekkusu Avatar

    Wtf is this?

    • JohanWiltink Avatar

      Please explain your issue with this kata. Or close it and go sulk somewhere else.

    • B1ts Avatar

      Well, for starters, half the solutions are not bugfixing anything. I thought the idea here was to modify as little as possible. If you made it so you could only modify 1 line (which is what I did), then maybe the kata would have some legs, but as is, I'm hovering over downvote button :P

    • JohanWiltink Avatar

      I firmly believe in not forcing solvers to come up with "the ONE solution". If you can come up with any solution, you get to look to other people's ones and go "ooooh ..!"

      If I could award different numbers of points for solutions with less or more changes ( or even complete rewrites. I hope you're proud of yourselves ), I would. But I can only pass or fail solutions. I don't think it adds anything to tell solvers how many changes they made - they already know.

      Of course the program tackles an artificial problem in an artificial way. That's not the point, and the point I am trying to make comes across clearer if there are the least possible distractions.

      Lastly, I definitely did not want to rule out my own solution, which applies the single necessary bugfix to all concerned places. Because I think it's a good idea.

    • B1ts Avatar

      The point I was trying to make was that complete rewrites shouldn't be acceptable, in the way they're currently written. If the swaps were meant to reverse the array, for example, then solving it in different way could be acceptable - if you deem so. (I think that makes the kata fairly meaningless then)

      You're right that I tried forcing the 1 solution, which isn't ideal. I'm sure you could navigate around this problem by checking how many characters were added to allow more options (which would have it's own issues), but given how the problem is presented, there really should only be 1 or 2 solutions that focus on fixing the bug, and rewriting everything misses the entire point of this kata.

    • Blind4Basics Avatar

      @Johan: I won't search for it because I dunno how to find it, but another JS kata exists with the exact same fix to do.

    • user8436785 Avatar

      @B4B I think you're thinking of the return one where if you put the thing on the second line it won't work.

    • JohanWiltink Avatar

      Even if it's the same fix, I wouldn't consider this a duplicate of that because it's not the same bug.

      Would you?

    • JohanWiltink Avatar

      Bits,

      one of the problems is I am absolutely uninterested in trench warfare with cheaters. Every anti-cheat measure can and will be circumvented; cheaters gonna cheat.

      The only reasonable restriction I can think of is requiring at least 2 =s in the solution, because you can validly solve the kata without more than one [] ( just use a temporary variable. I wiould consider that valid ). If I look at the function.toString() for that, people will complain I need to get the solution text in Preloaded. And then I'll be investing good time in bad things. Because then someone will raise some other issue. I'm just not interested - let them cheat, karma will get them. It's absolutely clear you are not meant to completely rewrite the initial code; you're missing the point and you're doing it on purpose.

      I don't think that makes the kata meaningless. Such solvers will be using it in a way that was not intended, and I cannot guard against that.

      I honestly believe there is a target demographic for this kata. Some people write code like the initial code and don't know any better. ( No, they're not power users. ) I am honestly trying to educate those people. If power users want to cheat, have at it. They're not my target demographic.

      The one thing that will make me immediately unpublish this kata is when people start upvoting cheats as Best Practice. Clever is fine. But that would ruin it for me immediately. I sincerely hope nobody is immature enough to do this now that I've said it out loud. ( I give it two hours. But I hope to be proven wrong. )

    • B1ts Avatar

      I can understand most of this, and I do hope as well that there's users that could benefit from this. There can be a fine balance between keeping initial code and rewriting it to smth else, it doesn't have to be too strict, and if you choose to ignore it, then for all the rest of us - this is just an identity function. ( and that's a duplicate :P ) If you were to rearrange the elements in certain way, you could argue there's some use case there for fictional company or array reverser with 4 elements or whatever, but either way it feels like this idea is a few years too late to be a valid kata, IMO. We'll see how it's gonna turn out, I'm gonna leave my vote not casted for your sake :D

    • JohanWiltink Avatar
      Issue marked resolved by JohanWiltink 5 years ago