Ad
  • Custom User Avatar

    Thanks a lot for your detailed review and improvement suggestions. I will look into them all one-by-one. Indeed I wish I had more time for practising katas, I've been busy trying to put my lectures together, among other side-projects. I think that the entire community (newcomers to FP) could benefit from this series, since it's proven popular elsewhere - so hopefully I find a way of making it suitable to the CW format.

  • Custom User Avatar

    Also, a few tips to consider before you start rushing to re-author and re-publish each Kata:

    1. Perhaps you should spend a bit more time on CW and complete a few more Kata (ideally of high satisfaction rating). After you have completed each Kata, take your time to study how the Submit tests for each Kata are written. This could potentially aid you in writing better tests for your own Kata. Also note that the input passed into the user function(s) are not usually stored in a variable/variables which appear in the Initial Solution - this would make it very easy for the solver to tamper with the "input" in his/her own solution which could allow him/her to "pass" the Kata very easily without actually implementing the solution correctly.
    2. There is a hidden rule in the CW community which is not written in either the Forum or the GitHub Wiki - namely "Do one thing and do it well". I've noticed that many of your Kata contains multiple tasks, sometimes not directly related, such as: (1) Define Array.prototype.map, (2) Use Array.prototype.map to define Array.prototype.flatMap, (3) use the array extensions you just defined to implement getVideoIds, (4) finally, use them to implement getSmallestBoxArt. Generally speaking, this is not favored by the CW community as it distracts the solver from focusing on a specific task and only serves to make the Kata long and cumbersome without making it more difficult and/or challenging. If there are multiple things that you want the solver to implement, you are better off splitting it into multiple Kata instead where each Kata focuses on a specific Task.

    Last but not least, you mentioned that your main goal of publishing these Kata is for use in your lectures? If your intended audience is not the entire CW community, allow me to remind you again that there is a better alternative called Qualified which allows you to create and share your code challenges to a specific audience instead of releasing it into the public.

  • Custom User Avatar

    I guess part of the problem is that each individual kata doesn't make much sense on its own, but only as part of the series.

    That might have been part of the problem but is definitely not the major cause. If you try to re-read your Kata description from the perspective of a beginner, you can hopefully realise that it is rather vague and underspecified:

    1. The "lesson" of your Kata (i.e. where you teach the theory and explain the key concepts) is not cleanly separated from the Kata Task (i.e. what you should do to pass the Kata). This means that all solvers are required to read through the entire Description regardless of their prior knowledge and ability in order to get a grasp of what is required of the Kata. This can be discouraging to solvers especially if the Kata Description becomes very long (something that I am very often guilty of :p). If you take a closer look at this Kata from the "Learning TypeScript" series, it separates the "lesson" from the "task" using two distinct headers, namely "Overview" and "Task". This means that solvers who already know about abstract classes in TypeScript can skip the "Overview" if they wish and jump straight to understanding the "Task".
    2. The "task(s)" of the Kata itself are largely unclear (and occasionally incorrect), perhaps partly because of the lack of concrete code examples in the Kata Description and/or the Sample Test Cases. For example, the description might say "return a list of [id, title]" which might sound clear to you as you know what you are talking about but it might be confusing for beginners - for example, (1) by "list" do you mean array?; (2) is the return value expected to be a single array of 2 items (the first being the id and the second being the title) or is it expected to be a (multidimensional) array where each element in the top-level array is an array of two items, like such: [[373, 'abc'], [2254, 'def'], [42, 'GHI']]? In order to eliminate potential confusion, it is always best to provide at least one comprehensive code example for each individual task in the Kata, either in the kata description or the sample tests (or both :D).

    That being said, it is often much appreciated to include links to other Kata in the same Series at the bottom of each Kata Description so solvers don't have to manually search for other Kata of this Series, like such (just one possible example):


    Kata in this Series

    1. Functional programming #1
    2. Functional programming #2
    3. Functional programming #3
    4. Functional programming #4
    5. Functional programming #5
    6. Functional programming #6
    7. Functional programming #7

    Speaking of the "Learning TypeScript" series you just mentioned, I didn't find it to be of particularly high quality (I only voted "Somewhat Satisfied" after completing one of them) and probably would not have approved it myself, but a few reasons why it might have been approved:

    1. Clear separation of "lesson" from "task"
    2. Task may not be unambiguously specified in the Kata Description but the Sample Test Cases provided to the solver makes the Task much clearer so a minimal amount of guesswork was required in my part to solve it (I got all Submit tests correct by the first attempt).
    3. Although the entire test suite only contains 6 assertions in total which isn't exactly awesome, it has complete code coverage as it tests for all input possibilities/scenarios and each assertion is accompanied with a fitting description which explains to the solver what is tested, e.g. "Boa; should be measured in Monkeys correctly", enabling easier debugging.

    That being said, if what you said regarding it being a rip-off from the official TypeScript docs is correct, then I am appalled by the absolute lack of reference to that website. That could potentially constitute a copyright infringement and/or plagiarism which I would definitely not encourage.

    So if I try to address the test feedback issue (it's better on the TypeScript side btw), and expand on the description so that hopefully they can sort of make sense individually, would you be willing to reconsider? I'm not going to put more effort into this if you disagree on the basic premise of porting this education series into the site.

    If the following improvements are done to each of your Kata, I would potentially reconsider my current satisfaction assessment:

    1. Separate the "lesson" from the "task" in your description so the experienced solver can focus on reading the important parts.
    2. Remove all traces of ambiguity from your "Task" by providing a concrete code example for every individual task of each Kata, e.g. if the task description says to implement a function getHighestRating which accepts an array of non-negative integers as input and returns the highest rating, an accompanying code example could be: getHighestRating([1, 5, 2, 4, 3]); // => 5
    3. When performing array/object (deep) comparison, replace all instances of Test.expect to Test.assertDeepEquals which should provide much better test feedback
    4. Achieve full code coverage by adding at least 10 distinct fixed assertions, each using different arrays/objects/structures and including some edge cases as well (e.g. what if the input array is empty?)
    5. Ideally add a few random tests after adding your fixed tests - they sometimes help catch logical flaws in the user's solution which are otherwise not caught in the fixed assertions

    However, note that this Kata has been automatically retired by the CW system due to the initial accumulation of downvotes so I doubt you can make this Kata (and the other 6) re-enter Beta even if the proposed changes were made on this Kata. In that case, you should perhaps consider re-authoring the Kata from scratch and publishing that instead (after meeting all of the requirements mentioned above).

    Cheers,
    @donaldsebleung

  • Custom User Avatar

    Thanks for your reply, at least now we can have some dialogue.

    I can't help but wonder just how much (or rather, how little) effort the author has put in in authoring such Kata

    Actually it has taken me quite a while to work on these, believe it or not. I've added both the JS and the TypeScript versions of the exercices, and the typed versions did not exist in the original series and I had to put it together.

    numerous major flaws in the Kata Description, test feedback, etc

    I guess part of the problem is that each individual kata doesn't make much sense on its own, but only as part of the series. If you check the originals (http://reactivex.io/learnrx/) you'll see that they make a nice cohesive whole. So maybe codewars is indeed not ideal for such education series. On the other hand, I have seen similar attempts, for instance have a look at the "Learning Typescript" series: this is directly taken from the TypeScript documentation, and exercises are almost identical as the examples given there. And there has not been any banning on these, which are now out of beta. I have actually made use of them for my lecture so I really enjoyed finding such simple fundamental katas on the site. Maybe we would need a more explicit support in the site for what is really "basic" content, or "learn a language" content.

    So if I try to address the test feedback issue (it's better on the TypeScript side btw), and expand on the description so that hopefully they can sort of make sense individually, would you be willing to reconsider? I'm not going to put more effort into this if you disagree on the basic premise of porting this education series into the site.

  • Custom User Avatar

    I appreciate the feedback, but not the tone in which it is given. What is this, some kind of place where standard rules of politeness do not apply?

    I acknowledge that my tone may have been a bit condescending and believe me or not, I probably wouldn't even have bothered raising an Issue and/or commenting on this Kata in the first place if it was just a single poorly-authored Kata - I've pretty much stopped moderating the Beta process on this Site for at least a month or two up until yesterday. But when I see seven poorly-authored Kata with major flaws in multiple aspects being published by the same author in rapid succession, I can't help but wonder just how much (or rather, how little) effort the author has put in in authoring such Kata. This is particularly disheartening for users like me who have used this Site for a long period of time because I have greatly benefited from this Site and its myriad content over the past two years which was only possible thanks to the numerous Kata authors who have actually spent the time and effort to craft high-quality Kata at all difficulty levels throughout the history of this Site. Therefore, (hopefully) you can imagine just how worried I was when I pondered the possibility of one or more Kata from this Series making its way out of Beta - if that ever happened, there would be one more low-quality Kata out on the Site which would (1) degrade overall Codewars content quality and (2) encourage more newcomers to author a bunch of subpar Kata (due to minimal effort being put in and being not well thought-out), a small fraction of which might eventually leave Beta and further degrading overall Codewars content quality. Furthermore, once there is such an exception (of a subpar Kata being approved from the Beta process), other newcomers will likely use the approved subpar Kata as a "shield" when arguing against Moderators which would make it more difficult for Moderators in the future to block such content from being approved. In the end, no one would benefit from this vicious cycle as overall Codewars content quality will be degraded to a stage where most users will no longer find the site valuable.

    Second comment: this is an education series ...

    I acknowledge the existence of education series on Codewars (hell, even I have authored a few myself) but surely, if that is the case, then shouldn't there be all the more reason to put even more time and effort to ensure that it is of top quality at the moment it is published? From my experience of completing this Kata (and every other Kata of this Series), the numerous major flaws in the Kata Description, test feedback, etc., may mean that it is actually doing more harm than good. I can only imagine a beginner stumbling upon this Kata and trying to complete it - in the process, he/she is likely to waste a lot of time and effort just trying to comprehend what is actually required of this Kata and would probably waste even more time if he/she doesn't pass all Submit Tests by the first attempt due to the lack of test feedback which provides no information whatsoever as to what failed and why. In the end, I would suspect that most beginners trying to learn would simply give up on this Kata and be discouraged from learning coding any further and even those who somehow manage to make it through would not be too happy about it.

    As a matter of fact, I'm teaching a lecture and this is why I've added this material - it's a nice environment for students to practice in. I understand katas are about a challenge, but this platform is really great for education as well, or is there some clause that this is forbidden?

    As I mentioned in the previous paragraph, certain well-crafted educational series are welcome on this Site but if you plan to mass-produce such educational Kata such that it floods the entire Kata search page and hides the challenging Beta katas beneath it, you'd probably be better off using Qualified which is basically Codewars for hiring and education.

    I will try to address the constructive part of your comments. In exchange, can I ask for reconsideration of your bashing? Btw isn't there to be multiple opinions on who decides to ban what?

    I will try to refrain from excessive criticism in the future but answering your last question, yes, there are a very small group of people who do not care about Kata quality whatsoever but the general consensus is that a Kata author should put in as much time and effort as possible to ensure that the Kata is at least of acceptable quality before publishing it for review in Beta.

  • Custom User Avatar

    First comment: if you're trying to discourage people for trying their hands at writting katas, way to go. I appreciate the feedback, but not the tone in which it is given. What is this, some kind of place where standard rules of politeness do not apply?

    Second comment: this is an education series. It's pretty popular actually, look here https://github.com/ReactiveX/learnrx: 1247 stars. So this might be boring for you, but not for people who never used map(), flatMap(), etc. And I haven't found any sort of equivalent educational katas when looking for "functional programming" and similar keywords. If you know some, I would be grateful for the reference, since writting katas is a lot of work so if I can avoid it all the better. This adaptation to codewars has been done with assent from the authors btw, see my github issue here: https://github.com/ReactiveX/learnrx/issues/167

    As a matter of fact, I'm teaching a lecture and this is why I've added this material - it's a nice environment for students to practice in. I understand katas are about a challenge, but this platform is really great for education as well, or is there some clause that this is forbidden?

    I will try to address the constructive part of your comments. In exchange, can I ask for reconsideration of your bashing? Btw isn't there to be multiple opinions on who decides to ban what?

  • Custom User Avatar

    Use your implementation to refactor the precedent kata, that is a function getIndexedReleases() which uses myMap() instead of forEach().

    What? You want us return what in the function getIndexedReleases()

    What?What?What?

  • Custom User Avatar
    1. Abuse of Test.expect makes debugging very difficult
    2. Insufficient code coverage (3 fixed assertions is not enough)
    3. Lack of random tests
    4. Constraints described in Kata Description (e.g. use of reduce) not enforced by Submit Tests
  • Custom User Avatar

    Important note: for the sake of this exercice, please refrain from using indexers. In other words, this is illegal: <code_example>

    You can't just say something is disallowed/illegal/whatever and expect solvers to blindly adhere to it in their solutions - you have to explicitly ban it either in the Preloaded section or the Test Cases (or both). Furthermore, I don't see the value in making plain array indexing illegal - it's one of the most primitive features in JavaScript and many other programming languages (it's not like a super powerful and handy built-in feature like Ruby's built-in prime checker).

    And of course, just because this Kata is unnecessarily convoluted (with an unacceptably low quality of test feedback due to abuse of Test.expect) does NOT mean that it is challenging and therefore adds any value to this site. I've spent like half an hour trying to complete this Kata despite the appalling quality of the Kata Description and Test Cases but in the end I felt that I had learned nothing.

    And please, next time, come up with your own (original, creative, genuinely challenging and/or highly educational) content instead of just copy-pasting code challenges as-is from external Web sources (well, at least you gave full credit to whatever source you're using but still ...). Everyone will be a lot happier if only you actually took the time and effort to craft a proper Kata of decent quality.

  • Custom User Avatar

    Apart from what I said in earlier Katas, if you really want the solver to define his/her own Array.prototype.filter, you need to first undefine it in Preloaded, like such: Array.prototype.filter = undefined;. On top of that, a few extra steps are needed to prevent the solver from re-importing the "canned" Array.prototype.filter but I won't elaborate on such techniques here.

  • Custom User Avatar
    1. Wrong initial solution name.
    2. Initial solution has wrong number of arguments.
    3. This time there aren't even Sample Tests for the solver to carry out his/her own tests.
    4. Abuse of Test.expect instead of using appropriate Test.assertDeepEquals
    5. Too few fixed tests - very poor code coverage
    6. No random tests

    Seriously, next time you post a Kata, consider whether it would actually add value to the site. What you're doing is the exact opposite.

  • Custom User Avatar

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

  • Custom User Avatar

    Do NOT use Test.expect for anything other than boolean assertions - it gives completely useless feedback upon failure and makes the kata extremely frustrating for the solver to complete.

  • Default User Avatar

    Is rating always present, is there always only 1 value? Why is it an array then?

  • Custom User Avatar

    So much wrong with this Kata.

    https://github.com/Codewars/codewars.com/wiki/Kata-Best-Practices

    1. Make sure content is new. forEach, map and friends have been done to death on CW.
    2. Testing - include fixed tests with full coverage of common cases and any corner cases ... Two assertions do NOT qualify as "full coverage".
    3. Testing - add random tests. Although it is not a hard requirement for 8 kyu beginner Kata like this one, it's good to include more test cases to prevent logically flawed and/or hardcoded solutions from passing.

    I would strongly suggest unpublishing this Kata (and the rest of your Series) and coming up with something much better.

  • Loading more items...