Current UBC undergraduate student, Debian/FOSS aficionado, and aspiring software developer.
Review: CPSC 110+121+210
June 23, 2012Posted by on
(Follow-up for my earlier “Advice for new UBC students – CPSC” blog post: )
Here’s my review for CPSC 110, 121, and 210, which I took in my 1st year as a UBC Science student, doing a major in computer science.
“Bad programming is easy. Idiots can learn it in 21 days, even if they are Dummies.” – How to Design Programs, 2nd Edition
This is an introductory computer science course (I know, I’m stating the obvious here), designed to teach students to design. In fact, the textbook you’ll be using is entitled “How to Design Programs”, a.k.a. HtDP. Incidentally, don’t go and buy that book from the bookstore unless you want a hard copy, because it’s available online: 1st ed. and 2nd ed., both of which you’ll be using (but only the 1st ed. is in print; the 2nd ed. is still a work in progress). Save yourself ~$75, and spend it on the required CPSC 121 textbook instead.
Anyways, for those who do have prior experience with programming, you may (or may not) be surprised that you’re not going to be taught Java in this course. In fact, there was an introductory CPSC course which featured Java (CPSC 111) and was equivalent to 110, but UBC axed it a few years back, so CPSC 110 is your one-and-only choice now. That’s not a bad thing per se; I have no doubts that beginner programmers will find Racket (which you’ll be using in 110) a LOT easier to work with than Java.
Racket itself originates from Scheme (it used to be called PLT Scheme); as with Scheme, it’s most prominently used within academia. In real life, and in real world settings, you’ll probably never come across Racket/Scheme. Rather, the point of CPSC 110 is not for you to learn Racket or its syntax (oh god, all those brackets!!! somebody save me…), but to learn the basic concepts of what “design” is, and how to go about programming, i.e. “designing” programs.
You’ll start off by evaluating simple arithmetic instructions in DrRacket’s interpreter (1+1), then learn about data and non-primitives, HtDF/HtDDD/HtDW recipes, lists, recursion (yes, you do learn recursion much earlier than you would in any other programming language), complex data, scope…up to the point where you’ll be able to complete the design of a Pacman game near the end of term. Yes, I know Pacman doesn’t sound like much, but it’s a lot more complex than you would think it is.
Labs are once a week; you get a short quiz, and then time to work on the lab (with TAs around to help you, and check you off at the end). There are practice exercises for you to work on during your own spare time, but they’re not mandatory; marks are given for the quizzes, lab completion, and of course, your exams (2 midterms + 1 final). Exams involve written code (yes, it sucks having to write code with pen and paper…good thing only 110 does this), but as long as you understand the concepts you learn in lecture, the exams are quite straight-forward. I liked my prof (Dr. Joanna McGrenere); she explained concepts pretty clearly in class and was always approachable; my TAs were also pretty friendly and supportive (although I felt as if it was occasionally difficult to ask for help during labs…sometimes there would be line-ups for questions, given that TAs often have to work one-on-one to help a student work through a problem with his/her code). CPSC 110 also uses Piazza (sort of like a class discussion/forum) instead of Vista/UBC Connect (personally, I feel that Piazza > Vista/Connect, so I’m fine with that).
Overall, it was a fun and worthwhile course (even though I’m probably never going to use Racket ever again), and I’d recommend it to everyone, not just CPSC majors, who would like to have a taste in what programming is all about.
Note: As Elle mentioned in the comments section below, UBC also offers a not-for-credit version of CPSC 110 online via Coursera. Prospective CPSC 110 students may be interested in taking a look at it to get a taste of what’s to come.
CPSC 121: Models of computation is quite different from the rest of the first year CPSC courses that you can take. Instead of focusing on software and program design, 121 shifts the focus to hardware and logic. This is sort of a 2-in-1 course; lectures cover logic and proofs (truth tables, propositional logic, predicate logic, various proofs, mathematical induction, sets & functions), while labs cover the hardware aspect of the course (you’ll work with the Magic Box or with Logisim to play around with very simplified circuits). This brings me to my foremost complaint about CPSC 121; lecture and labs seem to be completely unrelated to each other (this is akin to e.g. CHEM 121, where lecture and labs also seem to be completely independent of one another).
Early on, probably in the first lecture, you’re going to be introduced to the “4 big questions” (my prof, Dr. Patrice Belleville, regularly referred back to them, so I think it’s worth a mention):
1. How can we convince ourselves that an algorithm does what it’s supposed to do?
2. How do we determine whether or not one algorithm is better than another one?
3. How does the computer (e.g. DrRacket) decide if the characters of your program represent a name, a number, or something else? How does it figure it out if you have mismatched ” ” or ( )?
4. How can we build a computer that is able to execute a user-defined program?
What you’ll come to realize in this course is that your computer is nothing but a very, very complex grouping of parts that are capable of nothing else but simple logical operations.
There’s no programming done in this course at all (although sometimes your prof may use snippets of Racket to explain concepts in lecture). Marks are awarded for online quizzes (pre-reading for each chapter) done on Vista, ~5 assignments (roughly one every 2 weeks; do NOT leave them until the last minute, as most of them usually require several hours to complete, and it’s likely that you’ll struggle with a number of the questions…I definitely found the last 2 assignments difficult, given that writing proofs isn’t really my forte), labs, and 2 midterms + 1 final.
CPSC 210 is really an extension of what you learned in 110, but now, instead of learning how to “design” programs, you’re going to learn how to “construct” them. Eh, who cares about terminology…anyways, you’re going to be using a language called Java instead of good ol’ Racket, which is both good and bad. On the one hand, Java’s syntax can be harder to grasp once you’re used to Racket’s simplicity; however, unlike Racket, Java is actually used in real-life, and is currently the #1 (or #2, depending on your source) most popular programming language used in industry, so it’s definitely very well worth your time to learn Java, especially if you intend to pursue a career in software development.
The initial hurdle dealing with Java’s syntax can be frustrating at first, since the focus on lectures is to learn about various programming principles, not to learn about Java’s nuances. It’s definitely a different approach from 110. 110 is all about your prof holding your hand and teaching you basic syntactical knowledge, and guiding you as you write simple pieces of code. 210 is about having your prof (I had Dr. Mike Feeley) throw an entire codebase at you during your first lecture and telling you how to make heads and tails of it. The intent is for you to learn how to self-teach yourself a programming language, because Java is not the last language you’ll learn over the course of your future career; programming languages increase and decrease in popularity over the years, and it’s important for you to be able to learn new languages when you need to, in order to adapt to a rapidly changing tech sector.
…Whether CPSC 210 is successful at this, you decide. There is no assigned textbook in this course (AFAIK, Big Java used to be used in previous iterations of 210, but not any more, but it’s still a good reference if lectures notes aren’t sufficient for your needs), which can make 210 seem all the more frustrating at first. I came into CPSC 210 with rudimentary Java knowledge, and what little bit of programming experience I already had helped me to become fluent in Java fairly quickly. However, one of my friends struggled a fair bit with Java in the beginning; I’ve also met a few other 210 students who chose to spend a fair bit of additional time looking up references and doing some extra reading on Java. As the saying goes, your mileage may vary.
You’ll start off by covering control flow models, call graphs, UML class/sequence diagrams in the beginning, then move on to abstraction and how to implement it. You’ll also learn about data types, hierarchies, inheritance, type substitution, exceptions…by the end of this course, you should have a firm grasp of what object-oriented programming is, at least in Java. You’ll also cover various design patterns, e.g. composite, singleton, observers, etc. Marks are based on 2 labs randomly picked amongst the ~5 labs that you’ll do, a project (more on this later), and 2 midterms + 1 final. Note: You absolutely MUST pass the project in order to pass the course!
The project will take more than a month to complete, and is spread into 2 distinct sections, both weighted equally. You can work with one other person (pick your partner wisely, as this is definitely a lengthy project, and is going to be a lot of work, more than probably anything else in your other first year courses), and you’ll be implementing an Android app that guides the end-user around campus, highlighting various sustainability-related attractions and nearby food outlets…a mobile tour guide, more or less. The first half of the project is the non-Android portion, i.e. coding the data model that the app will use. The second half involves working on the interface of your app, and implementing Android-specific features (e.g. GPS tracking so the app knows where the user is and can suggest suitable tourist attractions on campus).
Do NOT leave the project until the last minute. That is possibly the worst thing you could ever do to yourself in CPSC 210. There IS a reason why you get a full month to finish it, and it’s not because your instructors and TAs are feeling generous.
What irks people about the project (you’ll inevitably see people complaining on Piazza, or even in class, about this) is that you’re given very little guidance on the project, i.e. it’s up to you to teach yourself how to, e.g. parse XML/JSON files, integrate your app with Yelp, implement GPS tracking, etc. You are not going to be spoon-fed the knowledge you require in lecture, so expect to do a lot of Googling/research on your own. But then again, you were thrown head-in into Java code on your very first day of lecture even if you had no idea what Java was, so you should really have gotten used to it by now.
I just want to step back a bit here and clarify a few things. First, if you’re concerned about the rather negative light I’ve put CPSC 210 in, don’t be. It’s a challenging and time-consuming course, yes, but it’s also a rewarding course: it highlights the challenges you have to overcome as a software developer, and helps you develop your own toolkit to approach those challenges and tackle them efficiently. If you do well in this course, you should be prepared to deal with future CPSC courses; if you ended up hating CPSC 210 with all your guts, it may be worthwhile to consider another career option aside from software development. Personally, I liked CPSC 210 as a whole, even though it caused me quite a headache at times.
And that’s all there is for now, folks! I’ll be doing a review of CPSC 189 (which I’m taking this summer), and of CPSC 213 + 221 (which I’m taking this upcoming September) later.