{"action":"created","issue":{"url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/647","repository_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code","labels_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/647/labels{/name}","comments_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/647/comments","events_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/647/events","html_url":"https://github.com/Chalarangelo/30-seconds-of-code/issues/647","id":313108942,"number":647,"title":"[GUIDELINES] Order of Decleration Change to Contribution Guidelines","user":{"login":"skatcat31","id":13894696,"avatar_url":"https://avatars1.githubusercontent.com/u/13894696?v=4","gravatar_id":"","url":"https://api.github.com/users/skatcat31","html_url":"https://github.com/skatcat31","followers_url":"https://api.github.com/users/skatcat31/followers","following_url":"https://api.github.com/users/skatcat31/following{/other_user}","gists_url":"https://api.github.com/users/skatcat31/gists{/gist_id}","starred_url":"https://api.github.com/users/skatcat31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skatcat31/subscriptions","organizations_url":"https://api.github.com/users/skatcat31/orgs","repos_url":"https://api.github.com/users/skatcat31/repos","events_url":"https://api.github.com/users/skatcat31/events{/privacy}","received_events_url":"https://api.github.com/users/skatcat31/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-10T22:17:27Z","updated_at":"2018-05-04T17:46:22Z","closed_at":null,"author_association":"COLLABORATOR","body":"Since this isn't something that even fits into our usual Snippet Issue Format since it's a proposed change poll to the Guidelines on Snippet Structure and Deceleration Order for function footprints, I'm going to just write out the current notices and propose a few solutions to look into:\r\n\r\n# Current Snippets Declaration Order is Not Consistent\r\nWe have several snippets that all implement different types of footprints. This has lead to some inconsistency in what a function looks like. We should come up with a new rule in the contribution guidelines so that in the future each snippet will have a consistent footprint:\r\n\r\n```js\r\n// Callback order\r\nconst func1 = (data, callback) => callback(data)\r\nconst func2 = (callback, data) => callback(data)\r\n\r\n// Library/Applicable order\r\nconst lib1 = (library, data) => Object.keys(library).reduce(RULEFN, {})\r\nconst lib2 = (data, library) => Object.keys(library.reduce(RULEFN, {})\r\n```\r\n\r\nWe had this discussion before with the `simpleHTTP` discussion however that never actually led to a change to the contribution guidelines. While we have the Adapter category and the bind function to allow us to transform any snippet to another form, we MIGHT want to declare what default footprint our functions should have. Especially since there are so many prior arts at this point we want to declare where we stand on it to avoid low quality or confus(ed/ing) submissions( see https://github.com/Chalarangelo/30-seconds-of-code/pull/646 for an example of it being unclear and the submitter making a decision due to the ambiguity ).\r\n\r\nI'm a fan of the way Ramda does things with Data last since it allows really easy library generation( at the sacrificing of debugability, it increases maintainability ), but I know not every one is, especially since it can make single use callbacks VERY confusing to read since you have to go through the function body before seeing what the function is applying too.\r\n\r\nAs such we should vote on the footprint Order of Operations so that when a snippet is submitted it will be in a form we can all agree will lead to faster reading and implimentation( see [API consistency](https://www.linkedin.com/pulse/from-back-end-robert-mennell/) and [library generation](https://www.linkedin.com/pulse/fun-programming-robert-mennell) for examples )\r\n\r\nJust like PEMDAS, we should know how our functions will apply. Thankfully these have parts!\r\n\r\n - Data  \r\nThe Data that will be operated on\r\n - Function  \r\nThe Function(s) that will be applied to the data\r\n - Libraries  \r\nThe Objects/Hashes/Arrays( data constructs ) used for certain operations in the Function or Snippet Logic\r\n\r\nPossibly Footprint:\r\n\r\n### FLD\r\n`(Functions, Libraries, Data)`\r\n\r\nAdvantages:\r\n\r\n - VERY friendly to library generation\r\n - Prior art from Ramda\r\n\r\nDisadvantages:\r\n\r\n - VERY confusing for one off closures since you need to read the function contents BEFORE seeing the data applied too\r\n\r\n### FDL\r\n`(Functions, Data, Libraries)`\r\n\r\nAdvantages:\r\n\r\n - .... Uh?\r\n\r\nDisadvantages:\r\n\r\n - Difficult to apply to library generation in cases where you want different functions at run time with the same library\r\n - VERY confusing for one off closures since you need to read the function contents BEFORE seeing the data applied too\r\n\r\n\r\n### LFD\r\n`(Libraries, Functions, Data)`\r\n\r\nAdvantages:\r\n\r\n - VERY friendly to applicative functions\r\n - Prior Art from Express( Data comes later as request come in )\r\n\r\nDisadvantages:\r\n\r\n - Difficult to apply to library generation in cases where you want different hashes\r\n\r\n### LDF\r\n`(Library, Data, Function)`\r\n\r\nAdvantages:\r\n\r\n - Very easy to read inline with closures, you know what the data being applied to is and what library will be modifying it\r\n\r\nDisadvantages:\r\n\r\n - HORRIBLE for library generation without am Adapter\r\n\r\n### DLF\r\n`(Data, Library, Function)`\r\n\r\nAdvantages:\r\n\r\n - So easy to read for simple closures\r\n\r\nDisadvantages:\r\n\r\n - Library generation requires a `Flip`\r\n\r\n### DFL\r\n`(Data, Function, Library)`\r\n\r\nAdvantages:\r\n\r\n - ... Uh? # 2\r\n\r\nDisadvantages:\r\n\r\n - Confusing Footprint with no prior art"},"comment":{"url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/comments/386676286","html_url":"https://github.com/Chalarangelo/30-seconds-of-code/issues/647#issuecomment-386676286","issue_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/647","id":386676286,"user":{"login":"skatcat31","id":13894696,"avatar_url":"https://avatars1.githubusercontent.com/u/13894696?v=4","gravatar_id":"","url":"https://api.github.com/users/skatcat31","html_url":"https://github.com/skatcat31","followers_url":"https://api.github.com/users/skatcat31/followers","following_url":"https://api.github.com/users/skatcat31/following{/other_user}","gists_url":"https://api.github.com/users/skatcat31/gists{/gist_id}","starred_url":"https://api.github.com/users/skatcat31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skatcat31/subscriptions","organizations_url":"https://api.github.com/users/skatcat31/orgs","repos_url":"https://api.github.com/users/skatcat31/repos","events_url":"https://api.github.com/users/skatcat31/events{/privacy}","received_events_url":"https://api.github.com/users/skatcat31/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T17:46:22Z","updated_at":"2018-05-04T17:46:22Z","author_association":"COLLABORATOR","body":"Updated the subject. If this doesn't get any more votes or comments in the next couple of days on Sunday I'll open a larger issue after doing a PR for updating the guidelines. Current choice is going to be `DLF` for simple adaption to `Data Last` footprint using `flip`"}}
{"actor":{"display_login":"skatcat31"}}