Skip to content

Commit 6395245

Browse files
committed
differences for PR #4
1 parent f5b668a commit 6395245

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

22-example-code.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exercises: 0
77
:::::::::::::::::::::::::::::::::::::: questions
88

99
- Why should I write readable code?
10-
- What is a "Code Smell"?
10+
- What is a "code smell"?
1111

1212
::::::::::::::::::::::::::::::::::::::::::::::::
1313

@@ -19,7 +19,7 @@ exercises: 0
1919

2020
::::::::::::::::::::::::::::::::::::::::::::::::
2121

22-
## Obtaining Some Example Code
22+
## Obtaining Example Code
2323

2424
FIXME: copy code-style-example into softwaresaved org
2525

@@ -104,15 +104,24 @@ the code is deliberately written to contain some issues!
104104

105105
## Why Write Readable Code?
106106

107-
QUESTION: who has seen or used code that looks like this? Yes/No?
108-
QUESTION: who has written code like this? Yes/No
107+
108+
:::::::::::::::::: discussion
109+
110+
### Readable Code
111+
112+
As a group, answer the following questions:
113+
114+
- Who has seen or used code that looks like this?
115+
- Who has written code like this?
116+
117+
::::::::::::::::::
109118

110119
No one writes great code that's readable, well formatted, and well designed all the time.
111120
Sometimes you often need to explore ideas with code to understand how the code should be designed,
112121
and this typically involves trying things out first.
113122
But... the key is that once you understand how to do something,
114123
it's a good idea to make sure it's readable and understandable by other people,
115-
which may includes a future version of yourself,
124+
which may include a future version of yourself,
116125
6 months into the future.
117126
So it's really helpful to end up with good clean code so yit's easier to understand.
118127

@@ -131,7 +140,7 @@ you can save yourself (and possibly others) a lot of time later!
131140

132141
::::::::::::::::::::::::::::::::::::::::: callout
133142

134-
## Does my Code Smell?
143+
### Does my Code Smell?
135144

136145
Developers sometimes talk about "code smells”.
137146
Code smells are cursory indications from looking at the source code that a piece of code may have some deeper issues.
@@ -148,7 +157,7 @@ Something to bear in mind when writing code!
148157

149158
Now despite the issues with the code, does it work?
150159
Let's find out.
151-
So in the shell, in the root directory of the repository:
160+
Within the shell, in the root directory of the repository, run the code as follows:
152161

153162
```bash
154163
python climate_analysis.py
@@ -168,7 +177,7 @@ Max temperature in Celsius 16.33888888888889 Kelvin 289.4888888888889
168177
```
169178

170179
And we can see that the code does indeed appear to work,
171-
with celsius and kelvin values being printed to the terminal.
180+
with Celsius and Kelvin values being printed to the terminal.
172181
But how can we improve its readability?
173182
We'll use a special tool, called a code linter,
174183
to help us identify these sorts of issues with the code.

fig/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"episodes/14-running-debugging.md" "f371f042deec6d37bdebb143ab851488" "site/built/14-running-debugging.md" "2025-05-09"
1212
"episodes/20-introduction.md" "ab522284cfcceb13671dfb1ca5670c97" "site/built/20-introduction.md" "2025-05-01"
1313
"episodes/21-setup.md" "eb31e0147eb4306d480fff570786023f" "site/built/21-setup.md" "2025-04-30"
14-
"episodes/22-example-code.md" "34472d5cba8ce3ddf8e6afce1fd5506d" "site/built/22-example-code.md" "2025-05-09"
14+
"episodes/22-example-code.md" "09910aacaafe716233edbe19a7da3e37" "site/built/22-example-code.md" "2025-05-26"
1515
"episodes/23-analysing-code.md" "d05ba920924358618760f44e5d5b5c74" "site/built/23-analysing-code.md" "2025-05-09"
1616
"episodes/24-linter-advanced.md" "ef63638ff387168de870df2d8a25d6d0" "site/built/24-linter-advanced.md" "2025-05-09"
1717
"episodes/30-introduction.md" "d0b6f39605e519787bc76b9e082680b3" "site/built/30-introduction.md" "2025-05-01"

0 commit comments

Comments
 (0)