Skip to content

Commit 8ecb7ce

Browse files
committed
Website build
1 parent 4cfa19e commit 8ecb7ce

File tree

8 files changed

+187
-10
lines changed

8 files changed

+187
-10
lines changed

0_introduction.html

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="body" role="main">
5151

5252
<div class="section" id="introduction-abstraction-in-mathematics-and-programming">
53-
<h1><span class="section-number">1. </span>Introduction: abstraction in mathematics and programming<a class="headerlink" href="#introduction-abstraction-in-mathematics-and-programming" title="Permalink to this headline"></a></h1>
53+
<span id="introduction"></span><h1><span class="section-number">1. </span>Introduction: abstraction in mathematics and programming<a class="headerlink" href="#introduction-abstraction-in-mathematics-and-programming" title="Permalink to this headline"></a></h1>
5454
<p>A core tool of mathematics is to define abstract objects and the
5555
operations which apply to them. This approach defines all the basic
5656
building blocks which enable us to reason mathematically and perform
@@ -106,6 +106,80 @@ <h1><span class="section-number">1. </span>Introduction: abstraction in mathemat
106106
from a mathematician’s perspective, understanding programming as a
107107
process of defining and manipulating mathematical objects, and
108108
scientifically testing and debugging the results.</p>
109+
<div class="section" id="how-to-do-this-course">
110+
<h2><span class="section-number">1.1. </span>How to do this course<a class="headerlink" href="#how-to-do-this-course" title="Permalink to this headline"></a></h2>
111+
<p>Programming, like mathematics, is a practical, problem solving discipline. It’s
112+
not possible to learn to program just by reading notes and watching lectures. To
113+
learn to program you need to put the content of the course into practice by
114+
writing code. The structure of this course is designed to help you to really
115+
understand new concepts in programming by putting them into practice. Each week,
116+
we run through the same cycle:</p>
117+
<ol class="arabic simple">
118+
<li><p>Read the notes</p></li>
119+
<li><p>Watch the videos</p></li>
120+
<li><p>Do the quiz</p></li>
121+
<li><p>Write the code</p></li>
122+
</ol>
123+
<div class="section" id="the-notes">
124+
<h3><span class="section-number">1.1.1. </span>The notes<a class="headerlink" href="#the-notes" title="Permalink to this headline"></a></h3>
125+
<p>All of the new material we cover in this course is presented in the notes. They
126+
always the starting point for your work. Each chapter will introduce new
127+
concepts in programming, often tied back to related mathematical concepts, and
128+
always illustraded by practical code examples. Python has excellent <a class="reference external" href="https://docs.python.org/3/">official
129+
online documentation</a>, and we link to that
130+
throughout the text. External links show up in orange while <a class="reference internal" href="#introduction"><span class="std std-ref">internal links
131+
to other parts of the notes</span></a> are red. Sometimes we introduce
132+
counterexamples: illustrations of code errors or bad implementation ideas. These
133+
will be flagged with a big red cross:</p>
134+
<div class="badcode docutils container">
135+
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="nb">print</span> <span class="s2">&quot;Hello World&quot;</span>
136+
</pre></div>
137+
</div>
138+
</div>
139+
<p>Conversely, if it’s necessary in context to highlight which approach is the
140+
correct one, the code will come with a big green tick:</p>
141+
<div class="goodcode docutils container">
142+
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Hello World&quot;</span><span class="p">)</span>
143+
</pre></div>
144+
</div>
145+
</div>
146+
<p>At the end of each chapter there is a glossary containing key new concepts
147+
introduced in that chapter. Always check the glossary and convince yourself that
148+
you understand all the terms introduced there, this is a good check on whether
149+
you have understood the chapter as a whole. However, there is more to learning
150+
new concepts than just the vocabulary, so don’t be tempted to skip reading the
151+
chapter and just jumping to the glossary!</p>
152+
<p>The chapters broadly alternate between introducing new programming concepts,
153+
such as <a class="reference internal" href="2_objects.html#objects"><span class="std std-ref">Objects and abstraction</span></a>, <span class="xref std std-ref">abstract data types</span>, or <a class="reference internal" href="6_inheritance.html#inheritance"><span class="std std-ref">Inheritance and composition</span></a>, and
154+
covering various aspects of the craft of programming, such as <span class="xref std std-ref">style</span>,
155+
<a class="reference internal" href="7_debugging.html#debugging"><span class="std std-ref">Debugging and testing</span></a>. In this way the course combines specific programming knowledge
156+
with more general coding skills.</p>
157+
</div>
158+
<div class="section" id="the-videos">
159+
<h3><span class="section-number">1.1.2. </span>The videos<a class="headerlink" href="#the-videos" title="Permalink to this headline"></a></h3>
160+
<p>Throughout the notes are links to videos. These aren’t typical lecture videos in
161+
that they’re not primarily focussed on delivering the new ideas in the course.
162+
In particular, the videos don’t set out to duplicate the delivery of the
163+
material in the notes. Instead, the videos focus on putting the concepts into
164+
practice, often by showing live coding sessions. Usually you’ll want to watch
165+
the video for a given section <em>after</em> reading the corresponding notes.</p>
166+
</div>
167+
<div class="section" id="the-quizes">
168+
<h3><span class="section-number">1.1.3. </span>The quizes<a class="headerlink" href="#the-quizes" title="Permalink to this headline"></a></h3>
169+
<p>Towards the end of each chapter is a link back to a quiz on Imperial’s
170+
Blackboard system. The quizes are designed to allow you to convince yourself
171+
that you’ve understood the material in the chapter. Sometimes they will simply
172+
be multiple choice questions testing your understanding of the material, but
173+
sometimes you will need to open up Python and try things out in order to work
174+
out the right answer. The quizes do not contribute to your module grade, but how
175+
well you are doing on them is an indication of your progress on the module.</p>
176+
</div>
177+
<div class="section" id="the-exercises">
178+
<h3><span class="section-number">1.1.4. </span>The exercises<a class="headerlink" href="#the-exercises" title="Permalink to this headline"></a></h3>
179+
<p>As we’ve already noted, really learning to program better is only achieved by
180+
writing code. The core of each week’s activities is therefore to ß</p>
181+
</div>
182+
</div>
109183
</div>
110184

111185

2_objects.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,12 @@ <h2><span class="section-number">3.4. </span>Encapsulation<a class="headerlink"
594594
</div>
595595
<div class="section" id="exercises">
596596
<h2><span class="section-number">3.5. </span>Exercises<a class="headerlink" href="#exercises" title="Permalink to this headline"></a></h2>
597-
<p>Obtain the skeleton code for these exercises from <code class="xref py py-obj docutils literal notranslate"><span class="pre">here</span></code>.
597+
<p>Obtain the skeleton code for these exercises from <a class="reference external" href="fixme">GitHub classroom</a>.
598598
The skeleton code contains a <code class="xref py py-mod docutils literal notranslate"><span class="pre">polynomial</span></code> package with a version of
599599
the <code class="xref py py-class docutils literal notranslate"><span class="pre">Polynomial</span></code> class.</p>
600600
<ol class="arabic simple">
601-
<li><p>Define the equality (<code class="xref py py-func docutils literal notranslate"><span class="pre">__eq__()</span></code>), subtraction (<code class="xref py py-func docutils literal notranslate"><span class="pre">__sub__()</span></code>),
602-
multiplication (<code class="xref py py-func docutils literal notranslate"><span class="pre">__mul__()</span></code>) and exponentiation (<code class="xref py py-func docutils literal notranslate"><span class="pre">__pow__()</span></code>)
601+
<li><p>Define the equality (<a class="reference external" href="https://docs.python.org/3/reference/datamodel.html#object.__eq__" title="(in Python v3.8)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__eq__()</span></code></a>), subtraction (<a class="reference external" href="https://docs.python.org/3/reference/datamodel.html#object.__sub__" title="(in Python v3.8)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__sub__()</span></code></a>),
602+
multiplication (<a class="reference external" href="https://docs.python.org/3/reference/datamodel.html#object.__mul__" title="(in Python v3.8)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__mul__()</span></code></a>) and exponentiation (<a class="reference external" href="https://docs.python.org/3/reference/datamodel.html#object.__pow__" title="(in Python v3.8)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__pow__()</span></code></a>)
603603
operations on the <code class="xref py py-class docutils literal notranslate"><span class="pre">Polynomial</span></code> class.</p></li>
604604
<li><p>Implement the <a class="reference external" href="https://docs.python.org/3/reference/datamodel.html#object.__call__" title="(in Python v3.8)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__call__()</span></code></a> method on the <code class="xref py py-class docutils literal notranslate"><span class="pre">Polynomial</span></code>
605605
class.</p></li>

_sources/0_introduction.rst.txt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _introduction:
2+
13
Introduction: abstraction in mathematics and programming
24
========================================================
35

@@ -60,3 +62,88 @@ and abstraction as they occur in Python. Furthermore, we will do so
6062
from a mathematician's perspective, understanding programming as a
6163
process of defining and manipulating mathematical objects, and
6264
scientifically testing and debugging the results.
65+
66+
How to do this course
67+
---------------------
68+
69+
Programming, like mathematics, is a practical, problem solving discipline. It's
70+
not possible to learn to program just by reading notes and watching lectures. To
71+
learn to program you need to put the content of the course into practice by
72+
writing code. The structure of this course is designed to help you to really
73+
understand new concepts in programming by putting them into practice. Each week,
74+
we run through the same cycle:
75+
76+
1. Read the notes
77+
2. Watch the videos
78+
3. Do the quiz
79+
4. Write the code
80+
81+
The notes
82+
.........
83+
84+
All of the new material we cover in this course is presented in the notes. They
85+
always the starting point for your work. Each chapter will introduce new
86+
concepts in programming, often tied back to related mathematical concepts, and
87+
always illustraded by practical code examples. Python has excellent `official
88+
online documentation <https://docs.python.org/3/>`_, and we link to that
89+
throughout the text. External links show up in orange while :ref:`internal links
90+
to other parts of the notes <introduction>` are red. Sometimes we introduce
91+
counterexamples: illustrations of code errors or bad implementation ideas. These
92+
will be flagged with a big red cross:
93+
94+
.. container:: badcode
95+
96+
.. code-block:: python3
97+
98+
print "Hello World"
99+
100+
Conversely, if it's necessary in context to highlight which approach is the
101+
correct one, the code will come with a big green tick:
102+
103+
.. container:: goodcode
104+
105+
.. code-block:: python3
106+
107+
print("Hello World")
108+
109+
At the end of each chapter there is a glossary containing key new concepts
110+
introduced in that chapter. Always check the glossary and convince yourself that
111+
you understand all the terms introduced there, this is a good check on whether
112+
you have understood the chapter as a whole. However, there is more to learning
113+
new concepts than just the vocabulary, so don't be tempted to skip reading the
114+
chapter and just jumping to the glossary!
115+
116+
The chapters broadly alternate between introducing new programming concepts,
117+
such as :ref:`objects`, :ref:`abstract data types`, or :ref:`inheritance`, and
118+
covering various aspects of the craft of programming, such as :ref:`style`,
119+
:ref:`debugging`. In this way the course combines specific programming knowledge
120+
with more general coding skills.
121+
122+
The videos
123+
..........
124+
125+
Throughout the notes are links to videos. These aren't typical lecture videos in
126+
that they're not primarily focussed on delivering the new ideas in the course.
127+
In particular, the videos don't set out to duplicate the delivery of the
128+
material in the notes. Instead, the videos focus on putting the concepts into
129+
practice, often by showing live coding sessions. Usually you'll want to watch
130+
the video for a given section *after* reading the corresponding notes.
131+
132+
The quizes
133+
..........
134+
135+
Towards the end of each chapter is a link back to a quiz on Imperial's
136+
Blackboard system. The quizes are designed to allow you to convince yourself
137+
that you've understood the material in the chapter. Sometimes they will simply
138+
be multiple choice questions testing your understanding of the material, but
139+
sometimes you will need to open up Python and try things out in order to work
140+
out the right answer. The quizes do not contribute to your module grade, but how
141+
well you are doing on them is an indication of your progress on the module.
142+
143+
The exercises
144+
.............
145+
146+
As we've already noted, really learning to program better is only achieved by
147+
writing code. The core of each week's activities is therefore to ß
148+
149+

_sources/2_objects.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,12 @@ pieces of data and a large number of complex functions.
613613
Exercises
614614
---------
615615

616-
Obtain the skeleton code for these exercises from `here <fixme>`.
616+
Obtain the skeleton code for these exercises from `GitHub classroom <fixme>`_.
617617
The skeleton code contains a :mod:`polynomial` package with a version of
618618
the :class:`Polynomial` class.
619619

620-
1. Define the equality (:func:`~object.__eq__`), subtraction (:func:`~object.__sub__`),
621-
multiplication (:func:`~object.__mul__`) and exponentiation (:func:`~object.__pow__`)
620+
1. Define the equality (:meth:`~object.__eq__`), subtraction (:meth:`~object.__sub__`),
621+
multiplication (:meth:`~object.__mul__`) and exponentiation (:meth:`~object.__pow__`)
622622
operations on the :class:`Polynomial` class.
623623

624624
2. Implement the :meth:`~object.__call__` method on the :class:`Polynomial`

_sources/index.rst.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313

1414
\mainmatter
1515

16+
This is the online textbook for MATH50009 Principles of Programming, a second
17+
year object oriented programming module offered to mathematics undergraduates at
18+
Imperial College London. This module will run for the first time starting in
19+
January 2021, so the material is still very much in development. Feel free to
20+
use this material to learn object-oriented programming in Python. I would be
21+
very interested to hear from anyone interested in using it to teach.
22+
1623
.. toctree::
1724
:numbered:
1825
:maxdepth: 2

index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,18 @@
4848
<div class="bodywrapper">
4949
<div class="body" role="main">
5050

51-
<div class="toctree-wrapper compound">
51+
<p>This is the online textbook for MATH50009 Principles of Programming, a second
52+
year object oriented programming module offered to mathematics undergraduates at
53+
Imperial College London. This module will run for the first time starting in
54+
January 2021, so the material is still very much in development. Feel free to
55+
use this material to learn object-oriented programming in Python. I would be
56+
very interested to hear from anyone interested in using it to teach.</p>
57+
<div class="toctree-wrapper compound">
5258
<ul>
53-
<li class="toctree-l1"><a class="reference internal" href="0_introduction.html">1. Introduction: abstraction in mathematics and programming</a></li>
59+
<li class="toctree-l1"><a class="reference internal" href="0_introduction.html">1. Introduction: abstraction in mathematics and programming</a><ul>
60+
<li class="toctree-l2"><a class="reference internal" href="0_introduction.html#how-to-do-this-course">1.1. How to do this course</a></li>
61+
</ul>
62+
</li>
5463
<li class="toctree-l1"><a class="reference internal" href="1_programs_in_files.html">2. Programs in files</a><ul>
5564
<li class="toctree-l2"><a class="reference internal" href="1_programs_in_files.html#the-python-interpreter">2.1. The Python interpreter</a></li>
5665
<li class="toctree-l2"><a class="reference internal" href="1_programs_in_files.html#python-scripts-and-text-editors">2.2. Python scripts and text editors</a></li>

objects.inv

15 Bytes
Binary file not shown.

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)