CS 330 Lecture 1 – Main
Dear students,
Welcome to CS 330! Think of a big graph, each of whose nodes is one of the many programming languages that have been invented. This class is not about those nodes. The graph also contains a node representing you. This class isn’t about you either. If it were, I wouldn’t be talking as much as I have already! Really, this class is about the edges between you and these languages. In this class, we want a few things to be true of your graph…
- We want to make sure you have many edges connecting you to the diverse landscape of languages. Coming into this class, you have likely seen a narrow way of thinking about computation through the lens of Java and C. You probably approach problems by writing some loops and conditional statements scattered across a class hierarchy and kicked off by something named
main
. - We want you to be able to hop from one node to another. Programming languages have their own economy. Old languages tend to have a lot of users and therefore do not change very quickly. That means new ideas, which are sometimes better, come in new languages. Some times these ideas can be ported over from one language to another. If that’s not possible, then we at least want to be able to write tools in different languages and allow them to interact. Instead of a king, we want a congress.
- We want you to be able to add new nodes to your graph. Sometimes a general-purpose language is too much. Maybe you’re building tools for end-user programmers who don’t have the time or inclination to learn a complete programming language. Maybe you are tired of the verbosity and punctuation of mainstream languages. These problems can be fixed by writing your own domain-specific language with a narrow set of commands.
This class is meant to be subversive. If it was housed in a humanities department, it would make your conservative parents uncomfortable, and I would appear on anti-education watchlists. My intent in this class is to knock down Authorities. But not political or religious ones. Technological ones. Like Java and C.
I think what happens to our brains is described well by psychologist William Perry. He studied college students like you in the 1950s and 1960s and found distinct patterns to their cognitive development. Let’s summarize the main stages:
- Dualism: I believe actions and beliefs are either right or wrong, and these labels are designated by an Authority that I can can trust. I shut my eyes and ears to the wrong; they deserve punishment, and they invite their misfortune. Example: My iPhone is a masterpiece of design and engineering, delivered to Earth by the almighty Apple. Android only exists because Google found enough monkeys that something had to emerge.
- Multiplicity: I am an Authority, and so are you. Right and wrong is a matter of opinion, and if you listen to others you’re a sheep. I’m going to do what I think is right, and you can do your thing. Anyone that says otherwise is a dualist prig. Example: A phone is a phone. I had to steal this iPhone, but they were overpriced and I had just spent the last of my paycheck on Steam’s Winter Sale.
- Relativism: I am not the Authority I thought I was, and you aren’t either. It turns out that some Authorities are charlatans and hypocrites. Some are right about area X but have it all wrong in area Y. Example: iPhones are great for people who want stuff that works out of the box. But main, Android phones are great for somebody who wants to tinker.
- Commitment: Based on what I’ve seen of the world, I trust much of what Authorities A and B have to say. But I will keep evaluating new Authorities that come along, and carefully weigh what they have to say. Example: I like my iPhone. Those new devices from Samsung have some awesome features, though. I hope Apple copies them soon and there’s no lawsuit.
In the world of technology, there is absolutely no reason to monogamously marry a programming language or a platform. There’s no need to choose. Your employer can get you an iPhone and an Android phone. You can use Windows, Mac, and Linux, either with virtual machines or dual booting. You can and should know many languages, continually learning new ones, because you are in a world where isRight
is neither true
nor false
. It is null
. Your world will shift underneath you, but you can save yourself some trouble by shifting it yourself. You must be prepared to update yourself, and that can’t happen if Java or C or Ruby or Javascript are the one true way. You have to love all your choices, but by knowing them, you can achieve what many critics do not: informed dissent.
Okay, with that discussion out of the way, let’s warm up our minds by comparing and constrasting some programming languages. In groups of 2 or 3, choose 3 languages in which you have written code. Contrast them according to these characteristics:
- Domain: Are there particular purposes or applications that the languages serve?
- Types: How do the languages treat a datum’s shape? What shapes are available? Can new ones be added? What must the programmer know about the shapes to write programs?
- Functions: How do the languages handle abstractions of code? How do functions relate to scope?
- Flow control: How does the programmer repeat code or alternate between code?
- Memory: Where can data live in memory? What responsibilties does the programmer have regarding memory?
Write your notes down on a 5×3 grid on a piece of paper, which you will turn in for the semester’s first participation point.
We will discuss your findings together. Arguments are encouraged.
This semester our primary goal is not to make you masters of a couple more languages, but we will talk in some depth about shell programming, C++, Haskell, Java 8, and Ruby. My number one goal, however, is for you to have an intellectual relationship with the tools that make computation happen. I want you to find ways to make programming less of a headache, your software products to run faster, and your future career to be intellectually stimulating.
One of my goals this semester is to be less of an Authority. In the past I haven’t been able to decide if I should be the first to broach an idea in lecture, or if I should ask you to read some other source first. I’ve probably leaned toward the former, and it’s frankly exhausting. That said, I will ask you to do more reading this semester than I have in the past, and during lecture we’ll discuss what you’ve read about and apply them in worked examples.
I hold firmly the belief that we learners undermine our learning by starting things late. So, one of the things I will do this semester to encourage timely reading is assign reading quizzes. These will count toward your participation, but only if you answer all questions correctly. You will have several attempts to perfect a quiz, but only one submission is allowed per day. The earlier you read and attempt the quiz, the more opportunities you have to earn the participation.
Here’s your TODO list for next time:
- Read the syllabus.
- Read Bash Scripting Tutorial.
- Watch your email for a link to quiz 1.
- Complete the three parts of homework 0 as soon as possible. Follow the steps in part 2 to fork the template repository before Wednesday for a participation point.
P.S. It’s Haiku Monday! This is Perryian commitment:
He is not the one
But I will still marry him
And then he will be