There's been this sentiment on HN and r/programming that computer science that is taught in universities is completely impractical and useless in the "real world" and is completely different from programming done in the workplace. I don't think that's the entire story.

A lot of people that read this blog are web developers. They're web developers in the sense that they write some portion of a website that directly deals with the user. Its either frontend (interacting with the user) or backend (answering the user's requests), but, the idea is the same; you're writing code that directly connects with your users. And, of course, there's a ton of people who write native apps for mobile devices. Again, there's a similar idea; you're developing software that directly deals with the user.

These people very rarely refer to things like the efficiency of a linked list over a doubly linked one or maybe how semantic analysis is performed in compilers. And, that's completely fine.

But, trouble starts when you've started to write code that doesn't in fact deal with the user directly. Maybe you want to bring a few SQL calls together before committing to the database to reduce hard drive seeking; that's not directly related to the user, but, its extremely important. At that point, you're going to need to know algorithms and how the scale. You will have to understand how filesystem implementations differ on certain issues.

For example, when I was first starting out with programming, I didn't really understand the difference between a linked list and array. I thought, hey, who cares, one extends and the other doesn't. Well, it matters. A lot.

Linked lists are pretty bad at indexing; $O(n)$ worst case, whereas an array is $O(1)$. Of course, you don't really notice this difference most of the time. But, I was writing a server that was supposed to process about 6 gigabytes of data per day (for financial markets), and I had made a rather stupid error.

I had a buffer that was storing some data that would be flipped to disk every time the buffer filled. I knew the size of the buffer, but, I thought "hey, why not just use a linked list, so, in case there's some kind of error, I won't get a buffer overflow". So, without understanding the theory behind the common abstractions we use, it gets rather difficult to write code that is fast.

Of course, things like finite automata aren't exactly the most practical, but, they still add an element of understanding, which is important.

If you're read this far, you should probably follow me on Twitter.

blog comments powered by Disqus
Mobile and Web Analytics