CS 105: INTRO TO COMPUTING,
NON-TECHNICAL
Max Fowler (Computer Science)
https://pages.github-dev.cs.illinois.edu/cs-105/web/
June 14, 2020
Video Series One Topics
What are the goals of this course (and why care?)
A few notes about the course
Computer and Programming Language Basics
Types and Type Conversion
Input vs Print
Goals
What is Computer Science, anyways?
“Computers are to Computer Science what telescopes are to astronomy”
– Edsger Dijkstra
CS is concerned with understanding…
What is computable
How to [specify computation, perform computation, communicate between
computers] in the [fastest, most reliable, most secure, cheapest/lowest
resource] way
How to help humans solve problems with computers
What are the course's learning objectives?
1. Given a small (5-10 line) Python program, students should be able to execute the
program in their head and correctly predict the outcome.
2. Given a small (5-10 line) Python function, students should be able to provide a
natural language description of what the function does.
3. Students should be able to write short (5-10 line) Python programs, including the
use of variables, expressions, conditionals, loops, and functions.
4. Students should be able to use built-in Python data structures including strings, lists,
and dictionaries.
5. Students should be aware of intermediate programming concepts including modules,
exception handling, user-defined types (classes)
6. Students should be capable of using basic and intermediate spreadsheet
operations (including INDEX, MATCH, and VLOOKUP), writing simple HTML
documents, and performing simple data analysis tasks.
What is "Programming?"
A series of instructions that
can be carried out by a
computer
A startlingly useful skill
A skill that is useful even to
be "aware" of http://www.programmingbasics.org/en/beginner/img/commands4.png
Other terms for Programs
Programs
Software
Applications
Code
But not
"codes"!!
https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/
https://twitter.com/m4tt/status/1138029336198561792
Programs do many things
Three parts of a program
Algorithms
A step-by-step process for achieving a result
Often written in pseudo-code
Ignore details
Increase generality
Programming
Express the commands in a form the computer understands
Testing and Debugging
Make sure the program works
And works correctly
Every time you run it
Why do we need programming languages?
"I saw the man in the park with the telescope"
Who had the telescope?
Who was in the park?
"With my telescope, I saw a man standing in a park…"
"I saw a man with a telescope standing across the street in the park…"
"While I was in the park with my telescope, I saw the man…"
Programming languages -> exact and unambiguous
Everything has a precise FORM (syntax) and precise
MEANING (semantics)
Syntax: Rules of what are acceptable programs
Semantics: Rules specifying WHAT a program does
This is all are largely arbitrary
Humans and programming languages are human made
If you haven't seen this before, there isn't any reason why you should know any of it right away
Easiest bugs to find? The ones you've made before
No shortcut around mistakes
Even experts make mistakes…
Video Question – what is an algorithm?
Notes about the course
Do…
Give the course website a read – particularly the
syllabus and announcements!
Sign up for Piazza, get access to Prairie Learn, buy
the book, etc. -> details in the first announcement
Check the course calendar – the due dates are
already up for the summer!
What is known about teaching and learning
No one can pay attention for 90 continuous minutes
Video snippets, rather than "a video" or "two videos"
Attention span? About 10-15 minutes
Watch with some focus
"Time on task" is a primary factor of how much gets learned
The course is intended to give you productive things to do
Doing is better for learning than reading or listening
Expending mental energy enables things to "stick"
What is known about teaching and learning
You can most efficiently learn…
Things related to what you know
Things that are only slightly harder than the things you can already do
Long term retention comes from repeated, distributed practice
Best retention – a cycle of forgetting and re-learning
Best spaced in time: cramming will not produce long term retention
What is the homework policy in CS 105?
Learning benefits from collaboration…
The extreme end – hire a stranger to tell you what
to type into homework
Formative vs Summative Assessment
Practice/Formative Assessment
Intended for learning, self-evaluation
In 105, this is the homework, reading activities, and labs
You may get help from ANYONE – but you need to type your answer
Summative Assessment
Evaluate how much has been learned
In 105 – The quizzes and the final
Has to be done by yourself (with limited materials)
What are the quizzes and exams?
7 quizzes using the Computer-Based Testing Facility's online proctoring (every Monday from 6/22 onward)
Sign-up with CBTF proctoring
https://cbtf.engr.illinois.edu/sched
50 minutes
The final – one three hour "mega quiz" (although not strictly "three times" as large), time TBD
Video Question – what is the homework policy?
Computer & Programming Language Basics
The major parts
Computers…
How many instructions a second can computers
execute?
Hundreds? Thousands? Millions?
GHz – billions of things a second!
Are computers "smart"?
No, they're dumb – and do exactly what you tell
them to do
Computers are dumb
On a "Linux" system
rm –rf / removes everything in "root", the / directory
Imagine deleting everything on your machine and not having an undo button…
https://jerrygamblin.com/2016/10/16/rm-rf-
still-works-on-osx/
Computers run low-level instructions
Computers don't "Play Despacito"
Instead, they…
Move a number from one storage to another
Add two numbers
Check if one number is larger than another
Go to a different place in code
Programming at this level…
Is tedious, error prone
Needs a LOT of code to do anything
Isn't portable – each processor type has their own "stuff"
High-level Languages (like Python!)
Productive, safer, portable
Why Python? Super useful language, gentle learning curve
Once you've learned a language, it is easier to learn others!
We use Python 3 (not Python 2)
Interpreted language
28
A
E
D
C
B
Where does Python run on the computer?
Video Question – which of the following is NOT
something a computer does as an instruction?
Types and Type Conversion
Python values have types
Early into the class, we'll meet two types: Strings: e.g., our string literals like “Hello CS 105!”
Integers: whole numbers of arbitrary precision
You can ask a value what its type is using: type(expression)
You can convert between them with str() and int()
It is important that you keep track of the types of your values!
31
Video Question – what is the type of x if x is
assigned using x = 23?
Input vs Print
Input vs print
input() gets user input (from a prompt) and returns a string
We can use input() empty OR with a prompt
print() prints OUTPUT to the screen – usually the same screen where
we get our input from!
What if I want to get a number input?
Video question on print
Assuming there is a variable value with the value 7, which of the
following statements prints: count = 7
A) print(“count =” value)
B) print(“count =”, end=“value”)
C) print(“count =”, value)
D) print(“count =” + value)
E) print(“count = $value”)