What is the course about?
This is a 1st year undergraduate course for geoscientists taught by Gerard Gorman. It is designed to be a first introduction to computer programming. No previous knowledge of computer programming, or indeed computing, is assumed. We will be covering core concepts in programming which you will be able to reapply to any other programming language that you are likely to encounter in the future.
The lectures notes are written in IPython notebook. This is a web-based interactive computational environment where you can combine code execution, text, mathematics, plots and rich media into a single document.
I did not sign up for computer science - why on earth am I doing this?
You might be asking as a geoscientist why on earth are you learning to program. You were expecting exciting field trips etc, not hours looking at a computer screen. The fact is that computing and at least basic programming are crucial skills in nearly all fields of modern science and engineering. It has many uses in data analysis, simulation and prediction. Irrespective of what area you pursue in geoscience, you will need to do somewhere between a little and a lot of programming. Another way I would sell the idea to you is ultimately, with just the right set of basic skills, you can automate all the boring stuff and focus on the fun stuff.
Hey, the lecturer is not lecturing us!
Let’s get this straight because it comes up every year - for a number of reasons I will not be standing in front, talking at you, for 3 hours each week. This worries some students because it does not align with the common notion of what a lecture entails. So let me explain…
For starters, in the best of circumstances the adult student can maintain focus for 15-20 minutes. Then you need refreshing or resetting. Sure you may sit passively for much longer and think you are learning/being taught but the scientific evidence says you are working sub-optimally and spend significant periods zoned out. Secondly, passive learning simply does not work for this course no more than it would work for learning to cycle. Computing programming is a practical skill and you mostly learn by doing it yourself. On the plus side the experience does not hurt nearly as much as learning to cycle.
For this reason we apply a form of blended learning. All the course material is online and you are expected to have read through the relevant material before a lecture. Let’s face it - you do not need me to read to you. The face-to-face lecture is based in the computer lab. There we will have a series of ~10 minute lectures to establish context/motivation, run through live examples and explore issues raised by you, the students. Most of the time you will be working through the exercises that make use of the concepts introduced in the lecture material. This should be a highly interactive experience with your peers (sometimes the best person to explain something is someone who just learned it themselves, as they are closer to your perspective), teaching assistants (we have a really good GTA/student ratio so make use of them!) and lecturer. While I have suggested a text book which you may choose to read sections of for greater understanding and entertainment - the critical aspect of the course is to complete these exercises. Just ask the students in the years ahead of you.
The exam for this course will also similarly involve a set of programming exercises. It is done in the lab just before we break for Christmas and is open book. If you do all the exercises then you can expect the exam to be trivial - last year 50% got above 70%. On the other hand if you do not to the exercises, chances are you will be lost.
Why Python? Why not [insert whatever language] instead?
Python is a modern, general-purpose, high-level programming language. It is widely used in science and engineering and overall has a significant share of the programming market share (see TIOBE). It is also one of the most popular introductary teaching languages. Its advantages are:
- Simplicity: It is easy to read and easy to learn.
- Expressive: Fewer lines of code, fewer bugs and easy to maintain.
- Powerful: Python is not a language you grow out of. It can also be used for large projects, Big Data, High Performance Computing applications, etc.
All the course notes are online. Sample solutions to the exercises will be made available after each lecture. If you miss a lecture (due to illness or other good reason) then make an earnest attempt at the exercises before reading the solution or you will deprive yourself of the learning experience.
This course loosely follows the text book A Primer on Scientific Programming with Python, by Hans Petter Langtangen. There are many copies in the library so do not feel that you have to buy it. As explained above, you do not have to read this book to excel in this course as the online course material is self contained. However, it is a good resource if you want to broaden your understanding of the subject.
One size does not fit all. Therefore, I encourage you to browse a few different resources suggested by students over the years (see below) which might appeal to your learning habits. Just remember to always go back and do the exercises to ensure we are all on the same page.