Today: Last lecture, 3x tech and society, your future in CS, conclusions
Thanks To Juliette and the Section Leaders
First: I'd like to thank Juliette and the section leaders, the only way this course can work is with their prodigious and generous efforts.
For Juliette and myself, teaching this class is very satisfying endeavor - it's great to see the light in someone's eyes (even on Zoom!) when the power we know in CS starts working for that student.
Art Show Nominees
Art Show Nominees
Art Show Voting
3x Tech and Society Questions
(1) Open Source Software, and (2) How The Internet Works, (3) Disinformation Challenge
1. Why Is Free / Open Source the Dominant Infrastructure?
How Open Source Works:
Let's look at Python
Open Source License - Contributions
- Python is distributed for free
- The "source code" is the code to produce Python itself
- Python has an "open source" license
Basically encourages contributing improvements back to Python source code
- There are many variations in open source licenses, but free and "contribute-back" are the keys
Open Source Economics
- This is an incredibly successful model for infrastructure
- I can build my system on Python, free, not dependent on one vendor
e.g. Build on Microsoft Visual Basic
Microsoft charged for it
And eventually they discontinued it
Building your expensive technology depending on one vendor looks bad!
- Google, Microsoft, and Apple .. all compete with each other
- But they all use Python
- All contribute to it
- Open source: common infrastructure, we'll all use, nobody's competitive advantage
- Advantage: notice lack of duplication of effort between
Apple, Microsoft, Google .. all using the same infrastructure code!
This creates some value, not duplicating effort
- Obviously in other domains they have their own tech and compete
2. Why Is Everything on the Internet Free?
- Disclosure: I used to work for Google
- How does Google make money?
- Advertising!
- Advertising is the payment system that runs the internet
- Running an internet services is pretty cheap
Compared to printing a newspaper
- So pennies of advertising revenue * millions of views = ok
- See ads as part of the system of content you are looking at
- Netflix is another model: charge users, show content, no ads
This is an alternative model vs. advertising
- The world will have room for both of these systems
1. Magazine, Newspaper, TV Model
2. Google - The Same
Or we can ad in the flow of money .. now it's a working system
- Editorial: this is a fine, not-objectionable business
- For this to work, the goole search results should be good
That's what brings the user here, what they like
e.g. actually answering the user's question
Then the ads are alongside to be seen
- Google wants good search results just like a TV network wants to have good shows
Things To Watch Google On - Sketchy
- Sketchy things google (or some other internet service) could do
- Thus far I think Google is ok, but here's what I would watch for...
- Sketchy: the ads and the content look the same
- Sketchy: greater percentage of ads, less percentage of content
- Sketchy: Google is so dominant, lacks competition
e.g. say you are an advertiser, how many competing advertising channels are available to you?
Yahoo Cautionary Tale
- Yahoo was dominant on early internet
- Ads grew to be more than 50% of their page, lots Ad animations
In the sort term, this made money
- It drove users away, the page was annoying!
- Now Yahoo is basically worthless
- Lesson: keep users happy, advertisers are 2nd most important
Without users, you have nothing
- I like this story - bad behavior getting a bad outcome
3. Depressing - Facebook / Youtube Disinformation
The most depressing feature of the content/advertising cycle above
e.g. Flat Earth Disinformation Story
- Suppose a user watches a "flat earth" video on youtube
This is conspiracy minded / disinformation
- What does Facebook / Youtube choose to put in front of that user next?
- Choose the video they are most likely to watch - maintain "engagement"
- What is the optimal choice for that next video?
- More conspiracy minded disinformation is the best (profitable) choice
Disinformation Tragedy
- Disinformation content is very compelling
For those who like it
A feature of human nature
- Therefore it is profitable
- Like a TV show they just watch and watch and watch
- I believe the 1st amendment free-speech is an important right
- So this disinformation cycle is a real challenge
CS106A Big Picture
- Programming is not some impossible, inscrutable magic box
- Programming is not only pasty dudes in the basement
- Many problems / areas can use programming as part of the solution
At Stanford, many students take a little CS
Programming is just a part to help their chosen field
- Many more people can do CS than think they can
Many students coming to Stanford don't see themselves in CS
CS106A tries to pick off a few was-not-planning-to-like-CS students
Women in CS Trend
Slide from Mehran Sahami, Stanford CS-Education
Lots of Need for Programmers
- How many programmers are in there in the US?
- At Stanford .. you would think it's like 25%
- Approx 1% of the population work formally as programmers
There are additional programmer-adjacent jobs, but still
- For comparison approx 12% of population works in health care
- Lots of programming is not done for lack of programmers
Products
Research
Films, games
- In other words, there is a programmer shortage
High programmer pay is also a symptom of the shortage
Story: I was on a bicycle, wearing shorts and a "Python" t-shirt stopped for a red light. A passerby in the cross-walk stopped as they were crossing the street, asking if I was looking for work.
Conclusion: programmer shortage
Pre CS106B chat..
Key Ideas We've Seen in Python
- Code ideas we've seen in Python
- Storing data
ints, floats, strings, lists, dicts
- Language features:
functions, parameters, strings, loops, if-logic, collections
- Good programming style:
Divide and conquer, decomposition
Testing functions
Readability
Your Second Programming Language
- There are many computer languages
- Other languages: C++, Javascript .. have the same elements as Python
ints, loops, strings, if-statements, ..
- Computer languages are 80% similar to each other
- Different syntax - superficial
- Your second language is surprisingly easy to learn
(you may be skeptical)
- Python has a "light" syntax
other languages have more to type in
- C++ or Java .. easy to pick up
Here is some C++ code
// comments start with 2 slashes
int i = 0; // declare type of var
while (true) { // curly braces
i += 1; // same as py, semicolons
if (i == 100) { // same as py + braces
break;
}
i += "Hello"; // error detected
// int/string types different,
// Error is flagged at edit-time:
// *earlier* than python, an improvement
}
- C++ code looks different
- Actually mostly familiar
- Picking up C++ will be no problem
- Advantage of heavier syntax: more auto error checking
- Also C++ runs much faster than Python
- Disadvantage: more to type in
- Fun fact: Python is itself written in the language C, related to C++
Possible Next Steps
Most Stanford students take 1 or 2 CS classes and keep with their chosen major. It's easy to imagine they use Python here and there as part of their work.
Next "CS106" CS106B
- The next step in CS - mixture of coding and CS
- Coding is a bit harder and more impressive
- Could take in Spring or next Fall
- Has section leaders
- Many non-CS-majors take this
- More powerful algorithms
- Uses C++ language - don't worry about this
- Recursion (beautiful) .. e.g. solving a maze
A sort of jaw-dropping idea when you get it
- Really understand: hash table (dict), sorting algorithms
- More hands-on use of memory
Scientific Python CME 193
- Python and scientific computing
- Applied (vs. CS fundamentals)
- See CME193
CS106E
- Tour of computing ideas
- Not focussed on programming like CS106A
- See CS106E
CS129 Applied Machine Learning
- Prerequisite is CS106B + linear algebra
- See CS129
Map of CS Major
- Programming core sequence:
CS106A, CS106B, CS107, CS110
- CS Mathematical core sequence:
CS103, CS109, CS161 (integer mathematics, probability)
- Then there are more courses in an area of concentration
Think About Section Leading
- Few schools have this opportunity
- Section Leader program - amazing thing at Stanford
- Section leaders are drawn from students who have completed CS106B
Don't need to be a CS major
- Section leaders - like code, like helping people
- Open secret: SLs pick up fantastic skills
debugging, organizing ideas, public speaking, confidence
Spring Opportunity For CS106A Students - Code in Place
- Project to share CS106A bits on the internet
- Section leading online - CS106A grads can do it!
- It is satisfying to help people - happiness research
- Using relatively easy parts of CS106A, so easy for you all
- See course page for "apply" link
CS Major Tracks / Concentrations
- If interested in majoring in CS
- Undergraduate CS concentration areas:
Artificial Intelligence (AI)
Human Computer Interaction (HCI)
Systems
Graphics
Biocomputation, (others)
- Choose a concentration, take advanced courses in that area
- HCI - call this one out, since most don't realize this field exists (below)
- CS Minor is a good deal
Up through CS107 and CS109 + 2 electives
This gives a strong CS background
Minor is a better idea than double-major
Human Computer Interaction - HCI Design
- What if you don't want to write code all the time?
- An unexpected part of CS
- Human Computer Interaction Design
- You can do an undergrad or grad emphasis in HCI
- More info: CS147 intro HCI
- aka "interaction design" - design manager
- Demo Image search: push pull handle HCI
- Door Push-Pull Handle
- The appearance communicates to the subconscious
- Great design works without the user thinking!
(analogy: film making to create an emotion in the audience)
- Mostly we notice HCI in the world when it is done badly
You click a control, and are surprised by what happens
- Open Question: what is the greater drag on human potential on earth:
Missing software, not coded up yet
Software with bad HCI design
Symbolic Systems Major
A sibling to the CS major - similar intellectual domains but less focus on coding
An interdisciplinary major that uses the lenses of CS, Philosophy, Psychology and Linguistics to study systems that use symbols to represent information. In Symsys you can concentrate on AI, Neuroscience, Natural Language, Philosophical Foundations or design your own concentration.
Big Data - Machine Learning
- Very hot areas in CS these days...
- Big Data
- Machine Learning
- Think about the Ghost project
Ghost Example
- Suppose you show Ghost to your parents
- Ask them how it works
- But now you know the internal story..
- Break it into a bunch of little numbers
- Have an algorithm, using + < ... to get the effect we want
- This points towards Machine Learning...
Machine Learning Sketch
- This is just a sketch of the idea
- "Machine Learning" - computed insights
- Cancer cell grading research
- e.g. Show the computer many example cell slides
- Program the computer to break out many different metrics of each slide
-dark/light, dark/light of boundaries, colors, number of cells, texture, ...
- Do not pre-bias the computer about the meaning of the various metrics
- Also give the computer the outcome data associated with each slide
- What if you have a million such slides
- Let the computer recombine all the data, sift out the patterns
- Not insight like a human
- Insight by looking at masses of data, guided by a human plan
Machine Learning - Very Promising
- Machine Learning is solving real problems in the world
- Much more sophisticated math than in Ghost
The math insight / framework is from the programmer
- The computer is sifting through the details
Art Show Winners
Congratulations to our bluescreen winners, in the best spirit of creativity and coding - we will be emailing out out a small prize to our winners as well.
winners link (eventually)
Where is the Magic in CS?
- The computer seems magic
- Such neat output
- But where is the magic?
Where is the Insight? The Power?
Where is the power in this story?
- You are the power in this story
- You have an insight about a problem to solve in the world
- You have an idea for an algorithm
- Python is just your instrument
- The computer solves a real problem, driven by your idea
- This is great story
- Fair well everyone!