Fork and clone this repository. Run the program to verify that it works – it’s supposed to download a GitHub user’s avatar image based on their username.
Now take a look at the code – OMG it is hideous. Lots of SCREAMING CAPITALS, lines smushed together, lines that trail off the edge of the screen, inconsistent variable naming schemes … it is basically the worst script ever.
Read PEP 8, the Python style guide, and identify at least four major improvements you can make to the code without changing its functionality at all. Implement these improvements one at a time, remembering to git add
and git commit
after each round. Push the cleaned-up repository to GitHub and @mention me on Slack.
For 3 points, practice starting from scratch and making your improvements until you’re able to make the changes in less than five minutes. Perform an informal demo* in class for credit.
*This will consist of cloning a fresh copy of the original repository, opening it in a command line text editor, then going through the “refactor-add-commit” process four times.