{"action":"created","issue":{"url":"https://api.github.com/repos/exercism/exercism.io/issues/1979","repository_url":"https://api.github.com/repos/exercism/exercism.io","labels_url":"https://api.github.com/repos/exercism/exercism.io/issues/1979/labels{/name}","comments_url":"https://api.github.com/repos/exercism/exercism.io/issues/1979/comments","events_url":"https://api.github.com/repos/exercism/exercism.io/issues/1979/events","html_url":"https://github.com/exercism/exercism.io/issues/1979","id":46227523,"number":1979,"title":"palindrome exercise description is vague and test suites are confusing","user":{"login":"LegalizeAdulthood","id":4270863,"avatar_url":"https://avatars.githubusercontent.com/u/4270863?v=3","gravatar_id":"","url":"https://api.github.com/users/LegalizeAdulthood","html_url":"https://github.com/LegalizeAdulthood","followers_url":"https://api.github.com/users/LegalizeAdulthood/followers","following_url":"https://api.github.com/users/LegalizeAdulthood/following{/other_user}","gists_url":"https://api.github.com/users/LegalizeAdulthood/gists{/gist_id}","starred_url":"https://api.github.com/users/LegalizeAdulthood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LegalizeAdulthood/subscriptions","organizations_url":"https://api.github.com/users/LegalizeAdulthood/orgs","repos_url":"https://api.github.com/users/LegalizeAdulthood/repos","events_url":"https://api.github.com/users/LegalizeAdulthood/events{/privacy}","received_events_url":"https://api.github.com/users/LegalizeAdulthood/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/exercism/exercism.io/labels/audit/problem","name":"audit/problem","color":"C76476"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-10-20T02:59:32Z","updated_at":"2016-05-25T18:14:38Z","closed_at":"2016-05-25T18:14:37Z","body":"The problem description [palindrome-products.md](https://github.com/exercism/x-common/blob/master/palindrome-products.md) and [palindrome-products.yml](https://github.com/exercism/x-common/blob/master/palindrome-products.yml) is amazingly terse for what is actually being required by the typical test suite (see [javascript](https://github.com/exercism/xjavascript/blob/master/palindrome-products/palindrome-products_test.spec.js)).\r\n\r\nThe [original cited problem](https://projecteuler.net/problem=4) inspiring this exercise is quite clear:\r\n\r\n > A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.\r\n>\r\n> Find the largest palindrome made from the product of two 3-digit numbers.\r\n\r\nYet somehow that mutated into the javascript exercise requiring passing this sort of test:\r\n\r\n```javascript\r\nit(\"largest palindrome from single digit factors\", function() {\r\n    var palindromes = new Palindromes({maxFactor: 9});\r\n    palindromes.generate();\r\n\r\n    var largest = palindromes.largest();\r\n    expect(largest.value).toEqual(9);\r\n    expect([[[3, 3], [1, 9]], [[1, 9], [3, 3]]]).toContain(largest.factors);\r\n});\r\n```\r\n\r\nI look at that last expectation and I'm truly baffled.  There is nothing mentioned anywhere in the original problem statement about what this array of arrays of arrays is supposed to mean.  From the problem description, the largest palindrome between 1 and 9 is obviously 9.  I can also see quite clearly that 9 has two sets of factors from single digit numbers: [3, 3] and [1, 9].\r\n\r\nWhat is totally confusing is why these factors appear twice as arrays where the order is different and why this needs to be a 3-deep nesting of arrays at all.  The test suite doesn't have enough tests to make it obvious via [tests as documentation](http://xunitpatterns.com/Goals%20of%20Test%20Automation.html#Tests as Documentation) why there needs to be three levels of nesting and why the factors need to be repeated twice in different order.  Similarly, the example solution is pretty confusing and this triply-nested structure and repetition of factors seems merely to be an artifact of the example solution and not something intrinsic to the problem.\r\n\r\nI tried looking at some other languages that had solutions and they also seem to suffer from this artifact without illuminating why this is a necessary element to the problem.  This makes me think that one language's solution was used as the inspiration for the solution in other languages."},"comment":{"url":"https://api.github.com/repos/exercism/exercism.io/issues/comments/221660515","html_url":"https://github.com/exercism/exercism.io/issues/1979#issuecomment-221660515","issue_url":"https://api.github.com/repos/exercism/exercism.io/issues/1979","id":221660515,"user":{"login":"kytrinyx","id":276834,"avatar_url":"https://avatars.githubusercontent.com/u/276834?v=3","gravatar_id":"","url":"https://api.github.com/users/kytrinyx","html_url":"https://github.com/kytrinyx","followers_url":"https://api.github.com/users/kytrinyx/followers","following_url":"https://api.github.com/users/kytrinyx/following{/other_user}","gists_url":"https://api.github.com/users/kytrinyx/gists{/gist_id}","starred_url":"https://api.github.com/users/kytrinyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kytrinyx/subscriptions","organizations_url":"https://api.github.com/users/kytrinyx/orgs","repos_url":"https://api.github.com/users/kytrinyx/repos","events_url":"https://api.github.com/users/kytrinyx/events{/privacy}","received_events_url":"https://api.github.com/users/kytrinyx/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T18:14:37Z","updated_at":"2016-05-25T18:14:37Z","body":"This is being discussed in the x-common repository: https://github.com/exercism/x-common/issues/208\r\n\r\nI'm going to close this issue in favor of the other one."}}
{"actor":{"display_login":"kytrinyx"}}