Skip to content

Latest commit

 

History

History
83 lines (75 loc) · 5.39 KB

README.md

File metadata and controls

83 lines (75 loc) · 5.39 KB

Week 6 • Version Control 3 / Refactoring

References

Assignment

  • The ideas this week are to practice refactoring code that you have already written and to continue practicing version control with Git.
  • Tip: Refactor your code in Git branches! See the steps in this week's (or last week's) class slides. Consider installing the Oh My Zsh shell framework (if not already implemented) to automatically display when you are in a Git repository along with the current branch.

Part 1: Refactor + Git

  • Create a local directory with a p5 project, initialize it at as a Git repository, and refactor a previous sketch so that the output is the same but the the code has been restructured.
  • You can refactor a sketch from this course or another one. If your sketch is in the p5 web editor, copy and paste the code into your local p5 project on your computer.
  • Challenge yourself to refactor a prior sketch that you really enjoyed but feels messy because you ran out or time, have a different understanding of how to implement programming concepts, and/or you have inklings that the code could be written in more efficient ways, i.e. "bad smells"
  • As you refactor, commit notable changes or milestones:
    • Look for repeating elements to convert into a loop, a function, or a class to make objects.
    • Is there any unused code to remove?
    • Can you make your code more readable? e.g. Any variables or functions to rename so that someone else reading your code can follow along without needing comments?
    • Adding comments are okay too! Especially to reinforce YOUR understanding of programming concepts and how your sketch works.
    • If there’s a lot of code, can you organize separate into different files? (See Coding Train video on how organize your code into multiple JavaScript files.)

Part 2: Document

  • Write a blog post that includes a link to your refactored code.
  • Describe and reflect on the changes you made and why you made them. How did it go with Git this week? For all of it (including the coding part), where did you get stuck, and what steps did you take troubleshoot? Anything that you would like to explore and practice more?
  • Submit here