Daniel Mai

What's Hard About Computer Science

Most people think that computer science is a really hard major. Hard, and nerdy. It’s about hacking (most likely the negative definition of the word). When they look at code they don’t know what’s going on. But that’s the simple part. If (get it, “if”) I give you something like this to read:

if this is true
    do this
else
    do that

I’m pretty sure you can tell me what that does. “do this” OR “do that” is done, depending on whether the condition in the if-statement is true or false. For example,

if I am tired
    go to sleep
else
    run a mile

Pretty simple logic1. If you regard yourself as a logical person, then this shouldn’t be a problem. Every statement of “code”, when looked at by itself, is essentially as simple as that—it’s just instructions. But it’s the big picture that’s hard to comprehend—big systems with lots of things happening.

Right now I’m writing a fairly complex program for work. It’s just a command-line tool that’s probably going to be used by several people this semester (who knows if it’ll still be used after this term—I think long-term is the plan, though), so I’m not dealing with something as complex as a graphical user interface, but it’s still pretty tough.

In order for me to design the tool well, I have to essentially “download” the source code into my head. I must know what every line I write does, and where it is located so that I can look for it and change it when needed. I have to have a mental model of the working program—how it works and how it is used.

It’s a lot of reading. Not only of my own source code that I write—the more I write, the more I have to read—but also documentation of the library functions that I’m using. I have to read a lot, and I have to write a lot. I need to write the documentation for this program as well, which means I need to give double the instructions—one for machines to read, the other for people to read.

I’m trying to wrap up the complexities in a simple package. And if I can’t do that for such a “simple” thing like a command-line tool, then what hope do I have for a much more complex application?

It’s like a huge homework project.

And I still have actual homework to do.

Like homework for my algorithms course I’m taking now. The little pieces that are used are easy when looked at by itself. But computer science gets really formal about it, and it’s all about the mathematics behind algorithms. We go out and about and use notation like Ω(lg lg (ln 2n!) to say that an algorithm’s run time is lower-bounded by the function lg lg (ln 2n!). And if you understand what that means, then you’re amazing. I’m stumped by “basic algebra” in order to show that something like (lg n)! > n3 is true.

Yay, mathematics. It’s the secret to life. At least, that was what my high school calculus teacher said. For calculus, anyway. And he quoted Newton on that.


  1. It’s the same fundamental logic that IFTTT is modeled after.