{"action":"opened","issue":{"url":"https://api.github.com/repos/phase-0/phase-0/issues/5377","repository_url":"https://api.github.com/repos/phase-0/phase-0","labels_url":"https://api.github.com/repos/phase-0/phase-0/issues/5377/labels{/name}","comments_url":"https://api.github.com/repos/phase-0/phase-0/issues/5377/comments","events_url":"https://api.github.com/repos/phase-0/phase-0/issues/5377/events","html_url":"https://github.com/phase-0/phase-0/issues/5377","id":356719642,"node_id":"MDU6SXNzdWUzNTY3MTk2NDI=","number":5377,"title":"8.2 Writing short functions","user":{"login":"engie15","id":34586511,"node_id":"MDQ6VXNlcjM0NTg2NTEx","avatar_url":"https://avatars3.githubusercontent.com/u/34586511?v=4","gravatar_id":"","url":"https://api.github.com/users/engie15","html_url":"https://github.com/engie15","followers_url":"https://api.github.com/users/engie15/followers","following_url":"https://api.github.com/users/engie15/following{/other_user}","gists_url":"https://api.github.com/users/engie15/gists{/gist_id}","starred_url":"https://api.github.com/users/engie15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/engie15/subscriptions","organizations_url":"https://api.github.com/users/engie15/orgs","repos_url":"https://api.github.com/users/engie15/repos","events_url":"https://api.github.com/users/engie15/events{/privacy}","received_events_url":"https://api.github.com/users/engie15/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"Rubymoyes","id":41361462,"node_id":"MDQ6VXNlcjQxMzYxNDYy","avatar_url":"https://avatars2.githubusercontent.com/u/41361462?v=4","gravatar_id":"","url":"https://api.github.com/users/Rubymoyes","html_url":"https://github.com/Rubymoyes","followers_url":"https://api.github.com/users/Rubymoyes/followers","following_url":"https://api.github.com/users/Rubymoyes/following{/other_user}","gists_url":"https://api.github.com/users/Rubymoyes/gists{/gist_id}","starred_url":"https://api.github.com/users/Rubymoyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rubymoyes/subscriptions","organizations_url":"https://api.github.com/users/Rubymoyes/orgs","repos_url":"https://api.github.com/users/Rubymoyes/repos","events_url":"https://api.github.com/users/Rubymoyes/events{/privacy}","received_events_url":"https://api.github.com/users/Rubymoyes/received_events","type":"User","site_admin":false},"assignees":[{"login":"Rubymoyes","id":41361462,"node_id":"MDQ6VXNlcjQxMzYxNDYy","avatar_url":"https://avatars2.githubusercontent.com/u/41361462?v=4","gravatar_id":"","url":"https://api.github.com/users/Rubymoyes","html_url":"https://github.com/Rubymoyes","followers_url":"https://api.github.com/users/Rubymoyes/followers","following_url":"https://api.github.com/users/Rubymoyes/following{/other_user}","gists_url":"https://api.github.com/users/Rubymoyes/gists{/gist_id}","starred_url":"https://api.github.com/users/Rubymoyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rubymoyes/subscriptions","organizations_url":"https://api.github.com/users/Rubymoyes/orgs","repos_url":"https://api.github.com/users/Rubymoyes/repos","events_url":"https://api.github.com/users/Rubymoyes/events{/privacy}","received_events_url":"https://api.github.com/users/Rubymoyes/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-09-04T09:11:15Z","updated_at":"2018-09-04T09:11:15Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"# 8.2 Writing short functions\n\nTake a look at your code from the calculator. Unless you've written perfect code, chances are some of it isn't as well-structured and [DRY](http://code.tutsplus.com/tutorials/3-key-software-principles-you-must-understand--net-25161) as it could be.\n\nYour task now, either with your pair or working alone, is to _refactor_ your code with a view to writing smaller functions that only have one job each. To help, consult the [Writing short functions](https://github.com/dev-academy-programme/curriculum/tree/master/resources/js-writing-short-functions-ARTICLE) resource.\n\n- [ ] Start Toggl.\n- [ ] Beginning with your original calculator code repository, check out a new branch called 'refactor'.\n- [ ] Work through all of the code, making small changes, saving and testing them frequently as you go along.\n  - _Working slowly and methodically is the key to staying calm during this process. Don't be tempted to change too much at once, only to find the code breaks and you're not sure why!_\n  - [ ] Each time you encounter part of your code that is longer or more complex than you'd like, move some of the code into another function.\n    - _As a very rough rule of thumb, if the function is longer than about ten lines it may need refactoring. Err on the side of creating a new function even if it seems unnecessary or pedantic, just to get the practice._\n  - [ ] Each time you create a new function, and have tested it to ensure that your code still works, create a new Git commit.\n- [ ] When you're done, push the new branch to GitHub and add a link to it in the waffle comments below.\n"}}
{"actor":{"display_login":"engie15"}}