In this chapter, we’ll open by discussing the course objectives.
We’ll then learn about the pragmatics of programming, exploring useful tools like text editors, version-control systems, and command-line shells.
Finally, we’ll introduce the Python programming language, then walk through the process of installing the Python interpreter in a live-coding session which culminates in the (in)famous “hello world” program.
1.01 Philosophy (8 min.)
1.02 Praxis I: The Command Line (14 min.)
1.03 Praxis II: Version Control (25 min.)
1.04 Praxis III: Text Editors (13 min.)
1.05 Praxis IV: Python (20 min.)
1.06 Praxis V: Python II (14 min.)
In this chapter, we’ll quickly review the semantics of the Python language, using an “abstract machine” model to build our intuitions.
Then, we’ll discuss the ongoing and long-running “software crisis”, and consider how we might take an engineering approach to programming, using tools like type systems and automated testing.
2.01 Python Review (12 min.)
2.02 Functional Python (19 min.)
2.03 Programming Like An Engineer I: Games For Computers (19 min.)
2.04 Programming Like An Engineer II: Types in Python (17 min.)
2.05 Programming Like An Engineer III: Testing in Python (17 min.)
In this chapter, we’ll (re-)introduce a key skill of engineering – and of software design.
We’ll apply the technique of functional decomposition to a case study about volumetric estimation of petroleum reserves, and build our first “real-world” Python program.
Along the way, we’ll also cover some Python paraphernalia including error handling, input and output, lazy evaluation, “code sandwiches”, and how to parse CSV files without pandas or any other kind of bear.
3.01 Case study introduction: volumetric reserves estimation (8 min.)
3.02 Functional decomposition (8 min.)
3.03 Case study live coding I (42 min.)
3.04 Python miscellany: I/O, iterators, “code sandwiches” (20 min.)
3.05 Case study live coding II (33 min.)
Chapter 4 – Data-Driven Design
This chapter introduces the concept of “data-driven design” through a case study about using Monte Carlo simulation for economic modeling.
In data-driven design, we move repetitive program logic from code into data structures, simplifying our programs.
Along the way, we’ll discuss some of Python’s various data structures, learn about trees, pass the coding interview, and work out how to accommodate it all in a static type system.
4.01 Case Study – Monte Carlo Economic Evaluation (5 min.)
4.02 Dumb Code, Smart Data (42 min.)
4.03 Arboriculture 101 and Intro to Fake Randomness (24 min.)
4.04 Python Fukubukuro II (18 min.)
4.05 Case Study – Live Coding (20 min.)
There’s no denying it: Python is slow. For various reasons, we’re stuck with the language, but not stuck with the speed!
In this chapter, we’ll learn why Python is slow, why it matters for engineering and technical applications, and introduce the NumPy library and other tools for getting more speed out of Python.
Along the way, we’ll also learn a very little bit about how modern computers actually work, a subject Python takes great efforts to obscure.
5.01 Batteries Not Included (20 min.)
5.02 NumPy in a Numpshell (19 min.)
5.03 Monte Carlo with NumPy (24 min.)
We’ve arrived at the core of Python: object-oriented programming.
But what on earth does “object-oriented” actually mean – and do any two programmers agree about it?
In this chapter, we’ll explore the separation of interface from implementation through a case study about petroleum decline curve analysis.
We’ll learn how – properly applied – object-oriented techniques can make our programs more flexible and future-proof.
Along the way we’ll also complain, a lot, about Python.
6.01 Case Study: Decline Curve Analysis (6 min.)
6.02 The Essence of Object-Oriented Programming (26 min.)
6.03 Abstracting Over Declines (42 min.)
6.04 Putting Re-Use to the Test (32 min.)
6.05 Against Chaos (10 min.)
If you’re reading this description, you’ve either made it through six fairly heavy chapters, or skipped ahead to the end to see what happens.
Either way, we salute you!
In this chapter, we’ll conclude the course by summarizing what we’ve learned and provide some hints for next steps in the world of Python programming.
We’ll also examine programming beyond Python through a survey of several languages with very different semantics.
Along the way, we’ll beat dead memes into the ground, insult the memory of Galileo, and understand the true value of Python by considering a bucket of mussels.
7.01 What Have We Done? (6 min.)
7.02 The Wide World of Python (22 min.)
7.03 Programming Beyond Python I (20 min.)
7.04 Programming Beyond Python II (19 min.)
7.05 Programming Beyond Python III (9 min.)