It seems like a lot of university-level computer science programs and programmer job interviews focus heavily on algorithms and data structures. I'm curious as to why universities and employers put so much emphasis on the theoretical aspects of computer science rather than on specific languages and technologies, which in my opinion is far more useful and important.

Doesn't it make more sense to look for programmers with a specific skill-set when hiring for an open job position? For example employers should require knowledge of C++, Java, etc. instead of all that theoretical garbage. Programming is a vocational career, you're supposed to know how to use certain languages and frameworks and the syntax and logic behind them.

Like if you search Google for "learn to code" you will see a bunch of websites that teach you how. They don't teach you about algorithms or data structures, but instead about syntax and the features of each language. So why are A+DS so important?

  • 2
    "All that theoretical garbage" -- =sigh=. So, you're given some code that's supposed to load some data files and search for a specific value, but it's performing way below spec. What steps would you take to speed it up? That's as practical a problem as you can find, but to solve it requires a solid theoretical foundation in algorithms and data structures. Using the appropriate algorithms and data structures can make huge differences in performance and efficiency. That's why interviewers care. – John Bode Oct 8 '13 at 21:01
  • If you pick the wrong data structer you can make load times from your app/program go from O(1) to O(N^2). Think about it... using an array when a hashtable could have saved all that processing. You can only understand why if you understand computer science. – NightSkyCode Oct 16 '16 at 23:54

You can play a musical instrument, say a guitar, to a reasonable standard without studying technique, be self taught, find a few chords on the internet, play a few songs.

If you want to play fast though, or play jazz, or play sufficiently difficult things with relative ease technique becomes important. It becomes important to understand what you're doing, and how you can do it more efficiently and "easily".

where "ease" usually means conservation of motion and effort. The key to doing things fast is to do less more often. These are things that require direction, practice, and understanding.

Algorithms, data structures and problem solving are the techniques of programmers. You can learn to code by just studying syntax and mucking about. But to be a truly great programmer? you must understand the art, the technique. Beautiful code is simple, direct, much like playing an instrument with poise and grace.

Anyone can write code, and anyone can play E on a guitar. But to call yourself a programmer these are the things which you must master.

  • 2
    Play an E on the ukulele. – JeffO Sep 26 '13 at 2:55

Learning about algorithms allows you to make smarter decisions about what code to write.

Imagine that you want to display a list of names in alphabetical order. How will you sort the list? The answer is an algorithm. Now, you could just use the sort associated with a data structure library you are using, and that might be fine. Now suppose you have 1 million names and you want to display the first 20 after sorting them. What if it was 100 million? Algorithms define how your program works, the more you know the more options you have.

Learning about data structures makes your code more efficient.

Back to that question about names. How do you store 10 names in memory? What about 100 Million? The answer may be different depending on what you want to do with the names. If you want to quickly check if a name is present you could use an array and look through it, or use a hashmap/dictionary and look up the name, or you could use a trie and store a minimal amount of information to find names very quickly. How you do hold the data determines how much data you can have and how fast you can access it.


Many of the applications we use, need to be fast and responsive. Take for example Photoshop, 3D creation app's, video games, Anti-Virus program's etc etc. Such app's need to be fast, so the client's can be more productive. But writen with simple math wouldn't be very fast even in performing simple mathmeatical tasks by the code. Mathematics offer great bunch of algorithms, one simple math task can be writen in different ways, some fast, some slower.

Take for example a prime generator, take the primitive calculations where you divide every number below it to see if it leaves any modulo. Write this down and run the program. Now write a Miller-Rabin prime test (algorithm) program, and see the difference in the speed. It will take over an hour to provide two million prime numbers with the first function. But with the Miller-Rabin algirthm, you can get these two million primes in less than 10 minutes. Both functions are doing exactly the same thing (allmost), they test for primality of a number, but the second function is finishing the task 10 times faster, becouse of the good algirthm.

Writing graphical code also require mathematics, fast algebra algorithms, so the program can run smooth, and fast, responsive, and so on.

Some of the math algirthms are fast, and writen in your application will result in a better, faster app. When I use 3D software, I want it to be faster like the light, and not to wait 3~ seconds every time i try to rotate that cube (polygon).

  • without an explanation, this answer may become useless in case if someone else posts an opposite opinion. For example, if someone posts a claim like "Mathematics is only 0,05% of a programmers skill", how would this answer help reader to pick of two opposing opinions? Consider editing it into a better shape – gnat Sep 26 '13 at 7:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.