@@ -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
2424FIXME: 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
110119No one writes great code that's readable, well formatted, and well designed all the time.
111120Sometimes you often need to explore ideas with code to understand how the code should be designed,
112121and this typically involves trying things out first.
113122But... the key is that once you understand how to do something,
114123it'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,
1161256 months into the future.
117126So 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
136145Developers sometimes talk about "code smells”.
137146Code 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
149158Now despite the issues with the code, does it work?
150159Let'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
154163python climate_analysis.py
@@ -168,7 +177,7 @@ Max temperature in Celsius 16.33888888888889 Kelvin 289.4888888888889
168177```
169178
170179And 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.
172181But how can we improve its readability?
173182We'll use a special tool, called a code linter,
174183to help us identify these sorts of issues with the code.
0 commit comments