Reading Code
Run
Run the code. See the output and what the code does and how it runs.
- go to the pull requests page for this assignment
- find your partner's pull request
- click into their profile to find their repo
- click on the repo address so that you can clone it
git clone {copied address}
- make sure that you run the command outside of where you have your own forked repo
Read
Read the code. Take time to see how the code makes the output you are seeing.
Read the code in a linear way from where you think it starts to where you think it outputs. If you don't know where it starts, try it backwards- begin where you think it outputs and try to work your way back to where you think it starts.
You can make changes:
- Write console.log for any part of the code where it's difficult to understand what the values are.
- Wrtie comments to youreself as you go to understand what the code is doing.
Note any questions you have about how the code works or what the reasoning is behind it working that way.
Meet
Meet with the person who wrote the code and ask them the questions you have, or if you are still not clear on how it works, ask them to explain it to you.
Changing the Code
Make changes to the code as you see fit.
If possible try to work on these three areas- they are listed in order of importance.
Errors
Does the code have any errors?
Does it handle all cases / kinds of inputs well? (i.e., empty input, long input, short input)
Could it check for input in a better or more thorough way?
Refactor
Once you have an idea of how the code works, is there anything you would do to rearrange or change it, to make it work better, or be written more clearly? Are there formatting changes you can make? Variables you would rename?
Add
Work on one of the furthers for this exercise in order to add new code.
Add code from today's lesson into this code.
Comment
- go to your partner's pull request. Make at least one comment on one of their commits.