-
Notifications
You must be signed in to change notification settings - Fork 1
Description
DISCLAIMER
I realize that duplicated katas are general problem on CW, which should be addressed as a whole. But since there is no technical means for that and there is no agreement how to do it, I just want to propose the other way: let's do it slowly, gradually, a kata by kata. I want this thread to be related to this particular set of katas mentioned below, and not a general problem. If we find a good solution for one instance of the problem, maybe then we will know how to resolve other ones too.
While hunting for challenging blue/easy purple katas to solve, I encountered following:
- Calculate the expression (5 kyu)
- Calculator (3 kyu)
- My BEDMAS Approved Calculator (3 kyu)
- Evaluate mathematical expression (2 kyu)
- Parsing and evaluation of mathematical expressions (2 kyu)
- Advanced Calculator! (beta/2 kyu)
- (added) Route Calculator (4 kyu)
I solved four of them with almost the same code, just with minor adjustments and/or translating from one language to another (I skipped the yellow and the beta ones). Each of these katas has also its own set of issues, like:
- description: sparse and insufficient, not all tested cases (for example, number formats) are described,
- tests: no random tests, no edge cases, only short/trivial expressions are tested,
- design: 'on error return -999999999', 'return calculated result or string on error', 'round to X decimal places', and several other WTFs
- no guard against external evaluation
- difficulty: all of them except (1.) are seriously overranked and do not live up to their difficulty ratings. Also,
eval
.
I have two proposals how this could be fixed, however it cannot be done by any regular user or power user and requires attention of a powerer-user or admin:
Easy fix: leave two (easier and more difficult) as they are, and retire the others. My picks would go to (1.) and (5.) as their rank fits the difficulty better than in case of others. This way no one needs to edit anything, no one looses any points, only the authors of retired katas are less exposed and potentially lose opportunity of future solutions (not a big loss for the site, if you ask me). But still, we are left with not-that-perfect (albeit quite good, I'd say) katas and can use regular means of fixing them (fork/edit/republish/invalidate solutions/repeat).
More challenging fix: Retire all and send them into oblivion. Provide two new katas with two levels of difficulty: 5 kyu for BEDMAS and no error handling, and 3 (maybe 2?) kyu for additional error handling and functions (but not only unary ones, but also binary, ternary, and variadic, for example avg(32, 8+9, 15, (2+2)*2)
, maybe performance test, and all common issues addressed (external eval, error handling with exceptions/return values, random tests, etc). Clearly state in the description that they are deduplicates of other katas. Keep an eye on new betas and slap everyone who submits a duplicate (three slaps for anyone who approves it). If you consider it's too much work, I volunteer to create new katas and translations.
Potential follow up: obliterate (6.)
NOTE: I want this thread to become some kind of beta drive or template for "community driven deduplication process", where others can search for more duplicates, cast ideas for what should stay, what should be gone, and what/how should be fixed. @Voileexperiments already created really nice and terribly long list here: codewars/codewars.com#1315 and I think CW really needs some way to handle such problems. If community will like it, we can go with other duplicates similar way. Maybe we will even get a dedicated board for "kata related issues" :) If you do not like the idea or do not think there is any feasible solution for duplicates (for example, for some reason katas cannot be retired "just like that"), then ok - just close this thread and I promise not to create "my new, great, bright idea" suggestions anymore :)