Why learn algorithms and data structures?

If you've been coding for while you may wonder what the point is of learning about algorithms and data structures, especially if you don't have a formal computer science or engineering background.

After all, how often do you actually have to use a linked list or write your own sort routine when you're making apps? The answer is: almost never.

However...

Knowing a little bit about the strategies used by algorithms to solve tricky problems gives you ideas for improvements you can make to your own code.

Knowing more data structures than just the standard array and dictionary gives you a bigger collection of tools you can use to build your own apps.

It will make you a better developer! (And better developers make more $$$.)

Algorithms lets you build software you couldn't otherwise build

There have been apps that I've been unable to create in the past because I got stuck on fundamental issues.

Often it was a matter of speed: I just couldn't make the program go fast enough. Thinking back on this now, I had chosen the wrong algorithms for these problems. If I had known more about the difference between O(n) and O(n^2), then maybe I would have had better luck.

Naive brute-force solutions work fine for small amounts of data, but sometimes you need to deal with lots of data. And then you need smarter algorithms.

There were also times I wasn't able to solve my programming problems at all, not even slowly. I simply didn't know where to begin. Understanding a bit of algorithm theory gives you various tactics you can try.

Don't spend any time memorizing algorithms

That's not the point. Instead, try to understand how different algorithms approach different problems.

Learn about techniques such as divide-and-conquer, dynamic programming, greedy algorithms. See what makes one approach slow and another fast, and learn what the tradeoffs are.

The key thing here is to get insight in how we can make computers do things.

It's not as scary as it sounds

A lot of algorithm textbooks start with a bunch of math. Truth is, the math is useful but most of the time you won't need it. So don't let that scare you. If you can write code, you can also understand all these fancy algorithms and data structures.

Trust me, algorithms are fun. :-)