UCSB CMPSC 8: Introduction to Computer Science
also: CMPTGCS 20: Introduction to CS for non-majors
CMPSC 8 is a course taught in the Dept. of Computer Science at UC Santa Barbara.
A course covering many of the same topics, “Introduction to CS for non-majors” is occasionally taught in CCS under the number CMPTGCS 20.
This site is maintained in this github repo: https://github.com/ucsb-cs8/ucsb-cs8.github.io. If you are a faculty member or TA that should have access to this page, contact Phill Conrad or Diba Mirza to request permission.
- Catalog Description including pre-requisites
- Older materials from Conrad’s 8wiki site.
- Older materials from Conrad’s personal website
Past offerings of CS8:
- Winter 2018, Ziad Matni
- Winter 2018, Richert Wang
- Fall 2017, Diba Mirza
- Summer 2017, Phill Conrad
- Spring 2017, Ziad Matni
- Spring 2017, Mike Costanzo
- [Winter 2016, Omer Egecioglu] Available to CS Faculty on the ECI systems in
/cs/archive/class/cs8/2017/winter/cs8/public_html
- Fall 2016, Matt Buoni
- Summer 2016, Çetin Kaya Koç
- Summer 2015, Veronika Strnadova
- Fall 2015, Çetin Kaya Koç and Emilie Barnard
- Summer 2009, Summer 2010, Fall 2010, Fall 2013
Which course should I start with? CS8 or CS16?
If you are taking your first course in Computer Science at UCSB, you may be wondering whether you should start in:
- CS8, which is intended as a first course in Programming
- CS8 targets folks that have never programmed before, and it is taught in Python
- CS16, which is intended as a second programming course.
- CS16 is taught in C++
- CS16 does not assume prior background in C++
- BUT, CS16 DOES assume prior background in programming (e.g. AP CS taught in Java)
So, there are some easy cases:
- If you have never programmed before, you should start with CS8.
- If you are proficient in Python or Java and confident of your programming abilities, but have not programmed in C++ before, you should start in CS16.
More nuanced cases are these:
- If you already do have some programming background, but you are not particularly confident of those abilities, or it’s been a while and you need a refresher, you should likely start with CS8.
- If you are proficient in C++ itself as a result of taking community college courses, check https://assist.org to see if those courses articulate to CS 16 (officially known as CMPSC 16) at UCSB. If so, you may be able to start directly in a later course such as CMPSC 24.
If you are still not sure, you may need to talk with an adviser. Brand new students can do this during summer orientation sessions when they register for courses. Continuing students may visit the CS adviser in the main CS office on the 2nd floor of Harold Frank Hall.
Textbooks
- Introduction to Computing Using Python, 2nd Edition (Perkovic)—Required Textbook for CS8 Spring 2018, Conrad
- Python Programming in Context, 2nd Edition—Required Python Textbook, S17 Matni
- accumulator pattern—using a loop to accumulate a result (e.g. a count, or sum)
- assignment statements—giving a value to a variable, e.g., x=5
- boolean expressions—and, or, not and De Morgan's law
- command line arguments—passing command line arguments to a Python Script
- CSV files—reading and writing CSV (Comma Separated Value) files in Python
- dictionaries—Mappings from keys to values
- files—reading and writing files in Python
- float—the data type that represents real numbers
- for loops—for loops in Python, from basic to advanced
- format—dealing with stuff such as print('a={0:5} b={1:7}'.format(a,b)
- functional programming—an advanced topic; an alternative to iteration and recursion
- json—Access JSON data in Python
- MacOS—Using Python on MacOS
- main blocks—All about that crazy looking `if __name__=="__main__":` thing that you see in some Python code
- pytest—Unit Testing with the pytest module
- Python 2 vs. Python 3—Understanding the difference and why it matters
- recursion—functions that call themselves
- scientific computing—Python tools for science and data analysis
- Python: selenium—Automating a web browser (for web scraping)
- Testing—Simple Interactive Testing of Python functions, and pointers to more advanced testing techniques
- Turtle Graphics—Some basics about turtle graphics
- Python: unittest—module for test-driven development in Python
- antipatterns—Things to avoid in your code
- bash—Unix command line shell, and a programming language
- Course Policies (Conrad):—Explanations of certain instructors course policies. May vary by instructor.
- Course Policies (Conrad): Answer Keys—Why do you not provide answer keys for all your old exams?
- CSIL: disk quota and file quota issues—How to diagnose and fix
- CSIL: git configuration—Configuring your CSIL account to use git
- CSIL: Via MacOS—Accessing CSIL from your MacOS system
- CSIL: Via Windows—Accessing CSIL from your Windows system
- data sources—Sources of interesting data to do computations over
- emacs—general purpose text editor with programmer-friendly features
- emacs: customization—making changes that happen every time you run emacs
- git/github—An introduction. git vs. github.com vs. github.ucsb.edu, repos, etc.
- git: basic workflow—The basics: git add..., git commit..., git push ...
- git: cloning your first repo—A guide for those new to git
- github: using ssh keys—generating public/private key pair, uploading public key to github
- github: ucsb-cs-github-linker—Using the local tool to join a course organization
- Gradescope—System for homework grading, feedback and submission
- Gradescope: Regrade Requests—What to do if you have questions about the grading of a problem (e.g. you think there was a grading error)
- Gradescope: Student Self-Submission—Scanning your assignment to PDF
- Number Conversions—Binary, Decimal, Octal and Hexadecimal
- practice—Resources to help you practice coding in Python, and/or how to think algorithmically.
- shebang—About that first line of some python files that looks like this: #!/usr/bin/env python
- submit.cs—An automatic grading feedback program used at UCSB
- Test Driven Development (TDD)—General information about best practices
- Unix: Misc tools—Various useful command line tools you may not know about
- vim—a widely used text editor among Unix users
- vim: customization—customizing vim for your purposes
- X11—Dealing with X11 DISPLAY issues
- Advanced Python Topics—For those that really want to go beyond the basics of intro course level Python
- Game Programming—Game Programming in Python
- IDEs for Python—Development Environments, Alternatives to IDLE
- Online Python Courses—Web sites with complete courses for learning Python
- Online Textbooks—For learning more about Python
- Other Online Courses—Other online courses (not Python specific)
- Practice Problems—Practice Problems
- Practice Problems: Recursion—
- Python Tutorials—Online resources for learning Python
- sample exams—Exams from previous offerings of CS8
Tutorials
- Flask Webapps—Getting started with simple Python-based webapps using Flask
- Flask Webapps: 01—Getting Started
- Flask Webapps: 02—ftoc (from url), and intro to templates
- Flask Webapps: 03—Better Navigation on your Web App with Nav Bars
- Flask Webapps: 04—Webapps on Heroku
- Flask Webapps: 05—Deploying an existing Flask App on Heroku
- Flask Webapps: 06—Working with Sessions in Flask
- Turtle Letters—Drawing Letters of the Alphabet with Turtle Graphics
- Turtle Letters: 01—Draw a T
- Turtle Letters: 02—Drawing an A
- Turtle Letters: 03—The bounding box, reference point, and Drawing an O (or a 0)
- Turtle Letters: 04—Planning your letters inside a bounding box (planning P and C)