12.28.04

Why study?

Posted in University life at 10:54 am by ducky

After working in the computer biz for fifteen to twenty years and being around computers for about thirty-five, I have finally started to take computer classes.I mentioned this to some of my colleagues, who went on a rant that CS classes taught nothing that was useful in the real world. They felt that the way you learned to write code was by writing code.

I decided to go to grad school in computer science anyway, and can articulate three reasons:

  1. to learn what is possible
  2. to find different ways of thinking and talking about problems
  3. to develop shared context

Possibilities

The very next day after my colleagues went on a rant about CS education being useless, I was in a meeting where one person suggested using a hash table.

I knew what a hash table was: a function that operates on data to spread it out into different buckets. I had also heard that coming up with a good hash function was hard.

There was a crucial detail about hashes that I had only learned a few days earlier in one of my classes: the hash function doesn’t need to give a different bucket for each and every data value. (This is called a perfect hash, and is, in fact, very difficult.) It turns out that instead, you make it so that there are only a few items in each bucket, and use one of a few pretty simple techniques for resolving conflicts.

I had never even tried to write a hash function because making a perfect hash looked so hard. In this case, formal schooling showed me what was possible.

Another example of something I had never known possible was Kruskal’s algorithm. Suppose you wanted to find a route through seven towns that went through each of them exactly once and had the smallest possible distance. Kruskal’s algorithm says that you can iteratively take the shortest path segment that connects two cities, and if it connects a city that hadn’t been connected before, keep it, otherwise throw it away. At the end, you will have a path of minimum distance. That you could make decisions on local conditions (i.e. the distance between two cities) that would end up being the minimum overall just blew my mind. (Those are called “greedy” algorithms.) I never would have attempted something like that without having taken that class.

Clearer thinking

At the same meeting where someone mentioned hashing, someone else silenced a discussion by pointing out that because WebDAV stored data as a tree and our repository was a graph, we would never be able to fully map our repository into WebDAV. People had been sort of saying that for a few minutes, but his putting it into more formal, precise language made the issue much more clear. In this case, formal schooling gave him a clearer way of thinking about the problem.

Shared context

Every once in a while, colleagues will make references to Turing machines over lunch. I sort of knew what a Turing machine was: it was a simple version of a computer with storage. I however, had never understood why Turing machines were any different from regular computers; nobody had ever explained the how limited Turing machines were. The neat part of Turing machines is that despite them being limited in the instructions that they can execute, they can simulate all the operations of any computer.

Now, in reality, Turing machines are not very useful in day-to-day coding. I can tell that. But they do come up from time to time in lunchtime conversations and watercooler discussions, and knowing what they do makes me part of the tribe.

Already, I have learned things from my classes that I didn’t know. Already, I have learned things that will be useful in programming in the future. I have confidence that taking classes is the right thing for me to do.