Skip to content

Commit 9528bd4

Browse files
committed
Website build
1 parent dd7dd29 commit 9528bd4

File tree

88 files changed

+50000
-5818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+50000
-5818
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 5ff65bcedd330e242d038831b0d2c397
3+
config: 4e1a97a485204c83c5530388f798fb5e
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

0_preface.html

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
2+
<!DOCTYPE html>
3+
4+
<html>
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
8+
9+
<title>Preface &#8212; Object-oriented Programming documentation</title>
10+
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
11+
<link rel="stylesheet" type="text/css" href="_static/fenics.css" />
12+
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
13+
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
14+
<link rel="stylesheet" type="text/css" href="_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
15+
<link rel="stylesheet" type="text/css" href="_static/panels-bootstrap.5fd3999ee7762ccc51105388f4a9d115.css" />
16+
<link rel="stylesheet" type="text/css" href="_static/panels-variables.06eb56fa6e07937060861dad626602ad.css" />
17+
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
18+
<script src="_static/jquery.js"></script>
19+
<script src="_static/underscore.js"></script>
20+
<script src="_static/doctools.js"></script>
21+
<script src="_static/proof.js"></script>
22+
<link rel="index" title="Index" href="genindex.html" />
23+
<link rel="search" title="Search" href="search.html" />
24+
<link rel="next" title="1. Introduction: abstraction in mathematics and programming" href="1_introduction.html" />
25+
<link rel="prev" title="Object oriented programming in Python for mathematicians" href="index.html" />
26+
<!--[if lte IE 6]>
27+
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
28+
<![endif]-->
29+
<!-- Global site tag (gtag.js) - Google Analytics -->
30+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0EFVH5C4DC"></script>
31+
<script>
32+
window.dataLayer = window.dataLayer || [];
33+
function gtag(){dataLayer.push(arguments);}
34+
gtag('js', new Date());
35+
36+
gtag('config', 'G-0EFVH5C4DC');
37+
</script>
38+
<link rel="stylesheet" href="_static/featured.css">
39+
40+
41+
<link rel="shortcut icon" href="_static/icon.ico" />
42+
43+
44+
</head><body>
45+
<div class="wrapper">
46+
<a href="index.html"><img src="_static/banner.png" width="900px" alt="FInAT Project Banner" /></a>
47+
<div id="access">
48+
<div class="menu">
49+
<ul>
50+
<li class="page_item"><a href="index.html" title="Book">Book</a></li>
51+
<li class="page_item"><a href="videos.html" title="Videos">Videos</a></li>
52+
<li class="page_item"><a href="exercises.html"
53+
title="Exercises">Exercises</a></li>
54+
<li class="page_item"><a href="installation.html" title="Installation">Installation</a></li>
55+
56+
</ul>
57+
</div><!-- .menu -->
58+
</div><!-- #access -->
59+
</div><!-- #wrapper -->
60+
61+
62+
<div class="document">
63+
<div class="documentwrapper">
64+
<div class="bodywrapper">
65+
<div class="body" role="main">
66+
67+
<section id="preface">
68+
<h1>Preface<a class="headerlink" href="#preface" title="Permalink to this headline"></a></h1>
69+
<p>Computers have revolutionised mathematics and the many scientific, engineering
70+
and economic fields in which mathematics is applied. In the applications of
71+
mathematics the role of computation has long been obvious and prominent. Now,
72+
the development of theorem proving software is increasing the prominence of
73+
computing in pure mathematics. What this means is that the ability to write
74+
computer programs well is an indispensable part of the toolkit of a 21st
75+
century mathematician and, indeed, scientist or engineer.</p>
76+
<p>Regrettably, university courses in mathematics and its sibling disciplines have
77+
often failed to reflect this revolution in the way that mathematics is
78+
practised. Far too often the sum total of programming education in an
79+
undergraduate degree is a computational methods module in which students are
80+
shown elementary programming constructs such as functions, loops, and perhaps
81+
plotting. These are introduced in the context of solving particular
82+
computational mathematics or statistics problems, and the programming
83+
constructs introduced are driven by what is needed to solve those problems.</p>
84+
<p>The assumptions underpinning this approach seem to be some combination of a
85+
belief that maths degrees should only teach maths, as well a feeling that the
86+
mathematical algorithms are some how the difficult part and that programming is
87+
a mere technical skill that students will somehow pick up along the way. The
88+
consequence of this approach is that many maths students and graduates end up
89+
without the programming, software development, and debugging skills that they
90+
need to make effective use of computers in their further studies or working
91+
careers.</p>
92+
<section id="what-is-this-book-for">
93+
<h2>What is this book for?<a class="headerlink" href="#what-is-this-book-for" title="Permalink to this headline"></a></h2>
94+
<p>This book is the result of a significant change in the mathematics curriculum
95+
at Imperial College London. Rather than assume that students will somehow
96+
acquire programming skills along the way, we have introduced first and second
97+
year courses with the sole objective of teaching students to programme well.
98+
This book is the text for the second of these courses. Named “Principles of
99+
Programming”, the course aims to take students with a knowledge of basic Python
100+
programming (functions, loops, plotting and so forth) and introduce them to
101+
higher level programming concepts.</p>
102+
<p>The objective of this course is to graduate better programmers. Material on
103+
new programming constructs and concepts is accompanied by chapters on good
104+
programming style, so that students learn how to write code that they and
105+
others can understand, and on errors, exceptions and debugging, so that
106+
students learn how to get themselves out of trouble.</p>
107+
<p>An underlying theme throughout this book is that programming has strong
108+
connections with mathematics. In particular, both mathematics and programming
109+
depend on building higher level, more abstract objects which encapsulate and
110+
hide the underlying complexity of operations. It is in taking this mathematical
111+
approach to programming that this book is “for mathematicians”.</p>
112+
<p>The examples are chosen from across mathematics. For example, it appears to be
113+
traditional in object oriented programming books to use a telephone directory
114+
as the initial example of classes. We eschew this in favour of a class
115+
implementing polynomials. This provides the opportunity to introduce
116+
encapsulation and operator overloading for a familiar mathematical object. In
117+
contrast to the traditional computational methods courses, the examples are
118+
chosen to illustrate and explain the programming concepts we study rather than
119+
the converse.</p>
120+
</section>
121+
<section id="who-is-this-book-for">
122+
<h2>Who is this book for?<a class="headerlink" href="#who-is-this-book-for" title="Permalink to this headline"></a></h2>
123+
<p>This book is for anyone with mathematical, scientific, or engineering interests
124+
who would like to learn to be a more capable programmer. The mathematical
125+
examples assume that you know how to differentiate functions of one variable,
126+
but very little beyond that. Where examples or exercises employ other
127+
mathematics, such as cellular automata in <a class="reference internal" href="4_style.html#style"><span class="std std-numref">Chapter 4</span></a> and
128+
groups in <a class="reference internal" href="5_abstract_data_types.html#abstract-data-types"><span class="std std-numref">Chapter 5</span></a>, enough of the mathematics
129+
will be introduced that the reader should be able to understand the programming
130+
concept being explained, without necessarily understanding all of the
131+
mathematical details of the example.</p>
132+
<p>This is not an introduction to basic Python: it’s assumed that the reader knows
133+
the sort of basic Python usually covered in a first programming or
134+
computational methods course. In particular the reader will be assumed to be
135+
familiar with writing functions, variable assignments, loops, and list
136+
comprehensions. The reader is also assumed to have used numeric and string data
137+
values, as well as dictionaries, lists, and tuples.</p>
138+
<p>Many introductory Python courses exclusively use Jupyter notebooks, so nothing
139+
beyond that is assumed. Getting set up with a working Python installation is
140+
covered in <a class="reference internal" href="1_introduction.html#introduction"><span class="std std-numref">Chapter 1</span></a> while the Python command line
141+
and using a text editor to create programmes in files are introduced from
142+
scratch in <a class="reference internal" href="2_programs_in_files.html#programs-files"><span class="std std-numref">Chapter 2</span></a>.</p>
143+
</section>
144+
<section id="how-to-use-this-book">
145+
<h2>How to use this book<a class="headerlink" href="#how-to-use-this-book" title="Permalink to this headline"></a></h2>
146+
<p>You can, of course, simply sit down and read this book from cover to cover,
147+
or dip in to see what it has to say on particular subjects. However,
148+
reading a book about programming will not teach you to program. For that,
149+
you need to get your hands dirty writing code and debugging your mistakes.
150+
The videos and exercises throughout the book are designed to help you do
151+
this.</p>
152+
<section id="the-videos">
153+
<h3>The videos<a class="headerlink" href="#the-videos" title="Permalink to this headline"></a></h3>
154+
<p>The videos were created to accompany the course at Imperial College London.
155+
They’re not primarily lecture videos but are instead practical demonstrations
156+
of the programming concepts being introduced at the relevant point. Usually
157+
it’s better to watch the video <em>after</em> reading the relevant section.</p>
158+
</section>
159+
<section id="the-exercises">
160+
<h3>The exercises<a class="headerlink" href="#the-exercises" title="Permalink to this headline"></a></h3>
161+
<p>At the end of each chapter are exercises. These usually depend on a skeleton
162+
code which is available on GitHub. Sometimes you might be asked to complete a
163+
piece of code while on other occasions you’ll need to write a whole Python
164+
module from scratch. Each set of exercises will come with a matching set of
165+
tests. These are small programs which check whether your code produces the
166+
correct responses to a range of inputs. Tests like this provide immediate
167+
feedback and enable you to know how you are doing. Links to the skeleton code
168+
for each chapter are provided at:</p>
169+
<blockquote>
170+
<div><p><a class="reference external" href="https://object-oriented-programming.github.io/edition1/exercises.html">https://object-oriented-programming.github.io/edition1/exercises.html</a></p>
171+
</div></blockquote>
172+
</section>
173+
</section>
174+
<section id="conventions-employed">
175+
<h2>Conventions employed<a class="headerlink" href="#conventions-employed" title="Permalink to this headline"></a></h2>
176+
<p>Each chapter starts by introducing new material, supported by the videos and
177+
exercises. At the end of each chapter is a glossary containing many of the key
178+
concepts introduced in that chapter. Terms to be found in a glossary are given
179+
<em>in italics</em> and can be looked up in the index.</p>
180+
<p>Python has excellent <a class="reference external" href="https://docs.python.org/3/">official online documentation</a>, and we link to that throughout the text.
181+
External links show up in purple while <a class="reference internal" href="1_introduction.html#introduction"><span class="std std-ref">internal links to other parts
182+
of the notes</span></a> are blue.</p>
183+
<p>The text sometimes introduces counterexamples: illustrations of code errors or
184+
bad implementation ideas. These will be flagged with a big red cross:</p>
185+
<div class="badcode docutils container">
186+
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="nb">print</span> <span class="s2">&quot;Hello World&quot;</span>
187+
</pre></div>
188+
</div>
189+
</div>
190+
<p>Conversely, if it’s necessary in context to highlight which approach is the
191+
correct one, the code will come with a big green tick:</p>
192+
<div class="goodcode docutils container">
193+
<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>
194+
</pre></div>
195+
</div>
196+
</div>
197+
</section>
198+
<section id="teaching-this-course-elsewhere">
199+
<h2>Teaching this course elsewhere<a class="headerlink" href="#teaching-this-course-elsewhere" title="Permalink to this headline"></a></h2>
200+
<p>The course of which this book forms the text has been given to master’s
201+
students at the University of Oxford, as well as to undergraduate students at
202+
Imperial College London. Instructors are welcome to use this material to teach
203+
elsewhere, and are encouraged to contact the author for assistance with access
204+
to materials.</p>
205+
</section>
206+
<section id="acknowledgements">
207+
<h2>Acknowledgements<a class="headerlink" href="#acknowledgements" title="Permalink to this headline"></a></h2>
208+
<p>The course Principles of Programming, and the notes on which this book is
209+
based, were first delivered in spring 2020, when university teaching was
210+
completely online during the COVID pandemic. I’d like to thank teaching fellow
211+
Dr Matthew Woolway who worked tirelessly with me on the module and who put
212+
together many of the tests on the exercises, and the graduate teaching
213+
assistants Miguel Boland, Sophia Vorderwuelbecke and Connor Ward whose
214+
professionalism in delivering the course in very complex circumstances was
215+
outstanding. Pulling out all the stops to deliver the written and video
216+
materials for online learning meant a lot of evenings and weekends. I am
217+
exceptionally grateful to my wife Gebina Ham for disproportionately picking up
218+
our childcare responsibilities in that period in order to make this possible.</p>
219+
<p>This is a textbook about programming in Python, so it would be remiss of me not
220+
to also thank the developers of the Python language, its CPython reference
221+
implementation, and all the third party packages which on which this book
222+
depends. In that regard, the developers of Numpy, Flake8, Pytest, PDB++ and
223+
IPython deserve particular mention.</p>
224+
<p>This book is typeset using the Sphinx documentation system. Among other things
225+
this facilitates generating the web, PDF, and print versions of the book from a
226+
single source. Thanks are due to its authors as well as those of the underlying
227+
LaTeX and TeX typesetting systems.</p>
228+
</section>
229+
</section>
230+
231+
232+
<div class="clearer"></div>
233+
</div>
234+
</div>
235+
</div>
236+
<div class="clearer"></div>
237+
</div>
238+
<div class="footer" role="contentinfo">
239+
&#169; Copyright 2019-2021, David A. Ham.
240+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.2.0.
241+
</div>
242+
</body>
243+
</html>

0 commit comments

Comments
 (0)