Pharm Chem 204 is intended to introduce students not merely to the coding of computer programs, but to computational thinking, the methodology of computer programming, and the principles of good program design including modularity and encapsulation. The Python® programming language is used throughout the course for all examples and homework problem sets.
Note that this course is listed under the "Scientific Methods" section of the UCSF course catalog.
Lectures emphasize object-oriented programming concepts and the design of algorithms and related data structures. Problem decomposition and principles of software engineering are stressed throughout the course. Numerical algorithms are a relatively small part of the instruction, and mathematical sophistication is not required. Rather we promote the use of fundamental principles from computer science such as designing effective data structures for representing information and writing efficient code modules that are extensible, maintainable, and reusable. Although Python is utilized for providing examples and doing the homework assignments, the principles taught are readily applicable to other modern programming languages.
In this course you'll learn how to write simple programs using Python, a dynamic object-oriented programming language that can be used for many kinds of software development projects. It offers strong support for integration with other computer languages and tools, comes with extensive standard libraries, and the basic principles of the language can be learned in a few days. Many programmers new to Python report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code. Many computational biology applications have been developed in Python, so there's a wealth of available Python modules that you can just download and use for your own research needs.
Upon completion of this course students will be able to:
- Demonstrate the principles of object-oriented programming and the interplay of algorithms and data structures in well-written modular code;
- Solve problems requiring the writing of well-documented programs in the Python language, including use of the logical constructs of that language;
- Demonstrate significant experience with the Python program development environment.
No explicit prerequisite course work is required, but students are expected to have a good understanding of basic computer principles. You will need to have access to a personal computer so you can write programs and do the homework assignments and the final project. Python runs on Windows, Mac OS X, and Linux, so almost any computer will do.
In class, we'll be showing programing examples on a laptop, either using the Python IDLE application or working inside a Terminal window. IDLE is the standard Python "Integrated DeveLopment Environment", while Terminal is a Mac OS X application. Terminal provides command line access to the Unix operating system, which is the basis of OS X. Some of the commands we'll use are basic Unix commands, and hence it's a good idea to spend a little time before the course begins learning these commands. There are countless Unix/Linux tutorials on the web; just Google "unix tutorial". We'll briefly cover the commands we use in class, but if you're new to Unix it's best that you learn about basic Unix use on your own; you'll follow our interactive examples more easily that way.
We'll be using Python 3 in this course. Python 3 first came out about a decade ago (before that it was Python 2). MacOS (up through 10.13) comes with Python 2 installed, but not Python 3. You can get Python 3 from the Python Releases for Mac OS X page. We strongly recommend getting the "macOS 64-bit installer" version of the newest release, which as of this writting is 3.7.0. To install, just double-click on the ".pkg" file after first saving it on your computer, then just follow the instructions. On Windows-based computers, where Python is not pre-installed, you'll need to install it yourself.
As noted above, Terminal provides access to the underlying Unix environment of MacOS, where it is easy to, for example, list files in a directory or easily examine their contents. When writing or editing Python code inside a Terminal window you use a "plain text" editor such as Vim or Emacs to write and modify your code. (Microsoft Word won't do, as it inserts all sorts of formatting and font data into your files which Python won't know what to do with.) Programs are then run from the command line via the Unix shell; the shell provides all sorts of short cuts and other cool tools to make your life as a programmer easier, so professional programmers often prefer Terminal over the more limited IDLE application. On Windows, you can use the standard Python distribution with your favorite text editor, use IDLE, or install and use PythonWin. For the homework and final project in this course any of these development environments will do just fine.
Title: Think Python 2e (free to download) Author: Allen B. Downey Publisher: Green Tea PressAlso see course materials for additional references.