Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate - sum of an array #73

Closed
3 tasks done
hobovsky opened this issue Jan 27, 2022 · 15 comments
Closed
3 tasks done

Deduplicate - sum of an array #73

hobovsky opened this issue Jan 27, 2022 · 15 comments
Assignees
Labels
discussion/deduplicate Discussion and vote what to do with duplicate kata

Comments

@hobovsky
Copy link
Contributor

hobovsky commented Jan 27, 2022

  1. Sum Arrays
  • 8kyu
  • No code restrictions.
  • 90% satisfaction, ~40k solutions.
  • 2 pending issues, some complaints about tests being susceptible to floating point inaccuracies.
  • 19 languages + 3 pending translations.
  • Published Aug 2014, author inactive.
  1. Sum The Array (removed as not a duplicate, see this post)

  2. Use reduce() to calculate the sum of the values in an array

  • 7 kyu
  • Asks for use of reduce, but it's not enforced too well.
  • 91% satisfaction, ~5800 solutions.
  • No pending issues.
  • JS only, pending CoffeeScript translation.
  • Published Mar 2014, author inactive.
  1. Get list sum recursively
  • 7 kyu
  • Asks for recursive solution, but does not enforce it at all.
  • 88% satisfaction, ~1600 solutions.
  • Two pending issues.
  • Six languages, 3 pending translations.
  • Published Aug 2016, author active.

ADDED:

  1. Sum with Arrows
  • 7 kyu
  • Asks for arrow function, but the idea is executed in a terrible way.
  • Satisfaction: 58% (!), ~2k solutions.
  • One pending issue, but many complaints on quality of the kata.
  • JS only (duh)
  • Published Jul 2015, author active.

Points to discuss:

  • Since every of the above kata asks for different kind of solution, are they really duplicates?
  • In 1., some languages use integers, and some use floating point values. Should these be unified? If so, how? Or keep them as they are now, and make sure the fuzzy equality is used for languages with floating point numbers?

Conclusion

@hobovsky hobovsky added the discussion/deduplicate Discussion and vote what to do with duplicate kata label Jan 27, 2022
@hobovsky
Copy link
Contributor Author

hobovsky commented Jan 27, 2022

My opinion:

  • Kata 1. is the most complete, but at the same time somewhat inconsistent. I don't like how it uses floating point values in some languages, because it adds to complexity of tests.
  • I like 2., because requirement of implementing an extension is interesting task when learning. Many languages use extension methods and similar things, so the requirement could be used in translations for C#, Scala, Swift, etc. Languages which do not allow for it could use regular, free functions.
  • I don't like 3. nor 4. because they ask for pointless restrictions which are close to impossible to enforce. Many solutions will end up identical to 1., so I don't see a real gain from these kata.
  • I don't like 5. because of its poor execution, low quality rating, and asking for a restriction which is difficult to enforce.

I'd say: retire 3. and 4. as useless. Retire 5 due to low quality. I hesitate between 1. and 2. because 1. is most feature-rich, but also flawed, and 2. is at least slightly interesting, but unfortunately lacks translations.

@FArekkusu
Copy link

I like 2., because requirement of implementing an extension is interesting task when learning

There're already plenty of katas where you have to extend an existing class; sometimes it's explicitly mentioned as a requirement and sometimes it isn't which makes it ambiguous whether it's a part of the (incomplete) specifications or just the author's design choice.

Since we're speaking about deduplication here, choose which of these points is true, and judge accordingly:

  • Kata #2 is about summing an array, the requirement to write an extension method is nothing more than a design choice (kata #2 is rightfully listed here)
  • Kata #2 is about writing an extension method for an existing class, the requirement to sum an array is simply an excuse for that (kata #2 doesn't belong to this deduplication issue)

IMO, leave 1 and retire the others.

@Kacarott
Copy link

Kacarott commented Jan 27, 2022

I also think keep option 1 and retire the rest. There are already other katas better suited to extending objects (summing only works when the contents are numbers, or maybe strings).

Edit: Burn number 5 with fire

@error256
Copy link

and make sure the fuzzy equality is used for languages with floating point numbers?

Or just generate safe input, something like 1000 x randint(-1000, 1000) * 2**randint(-15, 15), and compare exactly.

@ejini6969
Copy link

ejini6969 commented Jan 27, 2022

Same opinion as Kacarott & Farekkusu ~~ For 1. , we can choose to remove floating point numbers from some languages or keep them based on which one is easier to handle

Edit: send 5. back to the grave

@monadius
Copy link

Keep 1, 2. Retire 3, 4.

It is better to test integer arrays only in 1.

@CiprianAmza
Copy link

I consider the best to retire 3 and 4 as they ask actually (despite requiring recursion and using of the reduce function - without enforcing it) the same thing.

@akar-0
Copy link

akar-0 commented Feb 7, 2022

Keep 1 and 2. The task is very different and 2 is interesting per se. 3 and 4 are merely senseless duplicates of 1 since requirements aren't enforced. Make them mandatory would be make new katas from scratch, andhowver I'm not sure it presents a great interest.

@ejini6969
Copy link

Actually, 2. should be retired since it is a subset duplicate of https://www.codewars.com/kata/52195c9bb576caf14200007f/discuss
But I think it is better if we discuss this in a separate thread.

Also, https://www.codewars.com/kata/559f35bde66a7250f60000c9/discuss/javascript is actually kinda of a duplicate to all these too (I missed this one upon adding time, sorry) . It has:

  • very low satisfaction rating (one of the lowest on CW) --> 58%
  • 2312 solves
  • JS only
  • 7kyu
  • Description lacks clarity on parsing the result into string
  • Teaches bad practice as author insists on tweaking eval and not do a direct comparison between user's results and expected results.

Any opinions on this? Or should we discuss in another thread on retiring low quality katas? @hobovsky

@EloiseRosen
Copy link

EloiseRosen commented Feb 11, 2022

vote for keep # 1

edit for # 5: vote to also retire # 5

@hobovsky
Copy link
Contributor Author

Since there are some votes to keep 2., I will remove it from this set of duplicates and eventually include it in another set related to extensions methods (like Adding useful functional functionality to JavaScript arrays).

@hobovsky
Copy link
Contributor Author

I added Sum with Arrows as it was discovered after this discussion was created. Please edit your responses to add your suggestion on 5.

@FesterBesterTester
Copy link

FesterBesterTester commented Mar 11, 2022

The intention of # 3 is to introduce beginners to reduce(), so I would not consider it to be a duplicate of any of the other kata listed here.

@ejini6969
Copy link

@FesterBesterTester I know you're the author of the 3rd kata, but the thing is "duplicates" are not defined as having the same idea / concept anymore, instead, katas with direct questioning, requesting for identical solution are considered as dup despite yours having extra reinforcements ~~ Since your kata's solution can be retrieved from the first one and there's alr tons of kata solution out there that uses reduce to solve the problem, I see no point in keeping yours (Sorry to say

BTW: @monadius @CiprianAmza @FArekkusu @akar-0 , Any opinion on 5th kata?

@akar-0
Copy link

akar-0 commented Jul 30, 2022

Keep 1 only. I think it's not a real problem that some languages use floats while other use integers. AFAIK only in NASM it is signigicatively more difficult to handle floats in a kata like this one.

I know this opinion doesn't seem widely shared among the community, but I think it is not so important to invalidate solutions when it brings some benefice, for the kata and the general quality of Codewars. So I would favour to just use integers everywhere and make an explicit description.

@ejini6969 : I don't like this kata, I just see no point in doing this, but I have no real argument here, this is just a subjective opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion/deduplicate Discussion and vote what to do with duplicate kata
Projects
Development

No branches or pull requests