> ## Content Index
> Fetch the complete content index at: https://www.workroom-productions.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Exercise: Other People's Code
- URL: https://www.workroom-productions.com/exercise_other_peoples_code/
- Published: 2021-06-27T20:52:36.000Z
- Updated: 2022-04-22T21:48:48.000Z
- Description: Consider your own code through the lens of other people's code.
- Author: James Lyndsay
- Tags: Exercises, Coding

*Consider your own code through the lens of other people's code.*

**Purpose:** to reveal how to we might make our code more open to other people. 

**Method:** Read other people’s code. Identify what might make parts of that code easy or difficult to understand. Decide what you might adjust in your own code.

**Logistics:** 40-60 minutes, working group 2-10.

### Sequence

1. Pick your language / tech stack / area of interest

2\. Find some unfamiliar code which someone else has written. You might:

- Search in GitHub
- Look on Rosetta Code
- Pick up some code from elsewhere in your organisation

3\. Spend 10 minutes reading the code and any surrounding text. **Confusion is your marker** – keep track of the points where you’re wondering, whether you resolve it or not.

**Try to understand (several or all of):** its structure / its purpose / what it parameterises and returns / what keywords it uses / how it has named its data and functions / how it gets around tech stack weirdnesses.

4\. Come back to the group with one or more of the following

- An example of **something that you (initially?) struggled to understand**, and (if you can) the changes / comments / context needed to reduce that struggle
- If you understand it all, then an example of **something that you would do differently**, what you would do, and why you prefer your way

5\. The group will pick a few.

6\. Using those examples, consider what you might do to make any code you work on to be more-easily understandable.