Why we can’t have Nice Things
The other day, a TA told me I needed a setter variable in my lab, or I wouldn’t get credit, despite the fact that I had no need to modify the objects after instantiation. He gave me a whole spiel about how “in real life” you have to anticipate expansion of the program you’re writing, culminating in “think about it, did you really have to write that exception class?” Well, I wanted to say “yeah, I shouldn’t have written it.” I wanted to give him a piece of my mind about version creep, and about how trying to predict the future with premature optimization and the like only ends in failure (which I can say from experience). I argued with him for a bit, and then gave up, did what he asked, and immediately left.
How did we get here? How did we get to a point in the teaching of computer science where process is more important than the idea of the code? Where all programming requires design documents and useless objects for the sake of objects? When did computer science become software engineering? To answer that, we’ll need to travel to the complicated history of computer science and understand the overreaction that is our current teaching paradigm.
A Grossly Oversimplified Crash Course on the History of Programming
All modern programming languages come from two very different lineages: those descended from the ideas put forth with Alan Turing’s Turing machine (TM), and those from Alonzo Church’s lambda calculus (here the word ‘calculus’ is used to mean “a system of calculation,” instead of its better known mathematical meaning). The two formal systems have been proven mathematically equivalent, although they have rather different approaches to problem solving. C++ and Java, for example, have descended from TM way of thinking. In a nutshell, the difference is that lambda calculus focuses on functions, much like math. A mathematical function, given the same input, will always produce the same output, and the only way it affects the world around it is in its output. For example, the function x^2 does not “print out” anything–it takes an input and returns an output. TMs, on the other hand, focus on mutable data. A TM usually outputs something by changing the world around it. When you pass pointers to functions in C++, the function changes something that is outside of itself. In lambda calculus this is (almost) always forbidden.
More modern languages like Python and Ruby tend to inherit ideas from both sides of the “family.” They let you do cool things like pass functions as variables (ala lambda calculus), and they also let you write functions that change things outside of themselves. This is why programmers love them–they are generally inoffensive languages that do what you expect, and adapt to your specific style. I recommend learning at least one of the two. (There will be more on that in the last section).
School
Ah, now we get to the heart of things. The “whys” you’ve been asking yourselves as you stay up until 2am programming to finish that f**king design document. First, realize that CS education was not always this way. Originally, computer science was in the electrical engineering department of schools (interesting side note: in Europe, computer science was under the math department–that alone should tell you something about the different schools of thought in CS). It was an extension of digital logic design, in a sense. That was all well and good for a while, until the rise of more powerful computers, and the advent of the PC. In the upper echelon of engineering schools, a more abstract and intense programming curriculum was developed that was based more on lambda calculus. MIT had an infamously hard course called 6.001 which failed many, many bright eyed young students. It certainly wasn’t perfect; I’m sure a good many of those students were capable of programming, just perhaps not at that theoretical of a level. Still, the degree said “Computer Science,” and that’s exactly what it was, a science.
It was too theoretical. With the dot-com boom, there was an immense pressure on schools to not only graduate more programmers, but ones trained in languages that the industry actually used, not academic ones like Scheme and ML. With all the monetary influences pointing in that direction, it was only a matter of time before things changed. MIT’s intro class is now Python (which is not all bad, it’s just not as in depth as it used to be). In essence, the reason why you have to deal with all of the useless shit you do is because those are the processes that industry demands. And not the startups, but the behemoths. The IBMs and Oracles and all the soul-sucking jobs that you’ll find oh so exciting when it comes time to get one.
How not to be Boring
Read the book “Structure and Interpretation of Computer Programming,” and do all the exercises. This book is almost universally lauded by the better programmers in the programming communities. Perhaps more importantly though, it will add some perspective that is missing from your CS education–the theory. It will show you everything you can do without making an object, and how to make beautiful code. If you’re in CS because you like problem solving, because like me you see elegance in a good solution and you want to learn how to be that elegant, you need to read this book before graduation.
Next, learn Python. It’s easy. When you go to job interviews, and they ask you to write code, use Python. It doesn’t matter if Python wasn’t in the job description, all they’re asking you to do is show them you can code, and Python won’t trip you up with missing semicolons or wrong types. Python, in general, is a good way to express ideas quickly. (Ruby may be even better). See the blub paradox.
The biggest thing is just to do things you like. Don’t think that just because you’re in a CS class, you’re going to learn everything you need to know. That’s just not the way the world works. I’m sorry, but it’s true. If you like games, make a really really simple one. Start with the easiest thing you can think of, and work through a tutorial online. So long as you’re typing code, you’re learning, and what you learn on your own will be much more useful to you in the long run than any of the shit they make you do at school.
So really, you can have nice things. They just won’t be handed to you.