UC Berkeley - Chem 280 - Foundations of Programming and Software Engineering

These lessons are prepared for the MSSE program at UC Berkeley. These lessons cover the software development principles of version control, documentation, and testing through the development of a code to perform a molecular simulation. Students will create a Monte Carlo simulation code for noble gases using both Python and C++.

Prerequisites

Students should be familiar with opening the Terminal window and creating and navigating files in bash. Students should be familiar with basic Python syntax.

Course Lessons

Setup Download files required for the lesson
Day 1 1. Introduction to Foundations of Programming and Software Engineering What should I expect for this class?
2. Quick Introduction to the Command Line What is the command line?
How can I navigate files and directories on the command line?
3. Introduction to Version Control with Git How do I use git to keep a record of my project?
4. Using GitHub How do I use git and GitHub?
5. Code Collaboration using GitHub How can others contribute to my project on GitHub?
How can I contribute to the projects of others?
6. Group Homework Discussion Day 1 What’s the homework discussion for day 1?
Finish
Day 2 7. Intro to Monte Carlo Methods What are Monte Carlo methods?
How can I use Monte Carlo to estimate pi?
8. Monte Carlo for a Lennard Jones Fluid - Part 1 How can Monte Carlo be applied to a thermodynamic problem?
How do we model the interaction of nonbonded atoms?
9. Individual Homework Assignment #1 What is the first individual homework assignment?
Finish
Day 3 10. Monte Carlo for a Lennard Jones Fluid - Part 2 How do I write a Monte Carlo simulation?
11. Group Homework Discussion Day 3 What’s the homework discussion for day 3?
Finish
Day 4 12. Working with Numpy Arrays What are the differences between numpy arrays and lists?
How can I use NumPy to do calculations?
13. Using NumPy Arrays to Calculate Pi What are the differences between numpy arrays and lists?
14. Rewriting the Distance Function How can I rewrite functions to take advantage of NumPy element-wise operation and broadcasting?
15. Group Homework Discussion Day 4 What’s the homework discussion for day 4?
Finish
Day 5 16. Creating a Simple Python Package How should I organize my code?
17. Python Testing using pytest How is a Python module tested?
18. Group Homework Discussion Day 5 What’s the homework discussion for day 5?
Finish
Day 6 19. Intro to C++ What is the difference between compiled and interpreted languages?
What are the main advantages of C++ vs python?
What are some similarities between python and C++?
20. First C++ Program How do I write and compile a minimal C++ program?
What are the basic constructs of C++?
How do I handle compile errors?
21. Group Homework Discussion Day 6 What’s the homework discussion for day 6?
Finish
Day 7 22. Common data types What are the common, built-in data types in C++pointers and references in C++
When should I use each data type?
23. Arrays, Pointers, Memory, and Vectors What are pointers and references in C++
Why/when should I use a pointer or reference?
Pitfalls of using pointer
24. Group Project Assignment What are the potential projects for the final presentation?
Finish
Day 8 25. Function Calling and Arguments How do functions differ in C++ and Python?
How are arguments passed in C++?
How can we protect variables (and function arguments) from changing?
26. Namespaces How can we group functions together under a single collection?
How can I prevent collisions with functions having the same name in other libraries?
27. Exceptions How do we handle major errors in C++?
How do exceptions differ from python?
Finish
Day 9 28. Multi-file projects TODO
29. Documentation TODO
30. Testing TODO
Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.