The Truth About Algorithms and Data Structures
Tags: programming, computerscience, learning
Published: 2022-09-23 19:18:25

---
title: The Truth About Algorithms and Data Structures
published: true
description: How do you know when it's time to take the plunge?
tags: programming, computerscience, learning
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qn4o3ugm0aebtkgjlwln.png
canonical_url: https://davidamos.dev/algorithms-and-data-structures/
---

You can do a *lot* with very little.

Modern, high-level languages abstract away lots of details. You don’t need to know the difference between selection sort, bubble sort, merge sort, and quicksort, for instance, to use Python’s sorted() function. It just works.

Do you really need to learn how to use data structures and algorithms?

Well… I've got news for you:

## You're already using algorithms and data structures

Ever used a string? That’s a data structure. Written a `for` loop? That’s an algorithm.

![Two people trying not to step in puddles. The person on the left says: "Dude, these puddles are everywhere!" The person on the right responds: "There's no escape!"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4og507brdhkgw0wgl2id.png)

Algorithms and data structures are the building blocks of computer programs — even “Hello, World!” Over time, programmers recognize useful patterns they can apply to a broad range of problems. Language designers bake the most commonly used patterns into easy-to-use interfaces.
You don’t have to know how they’re implemented to reap the benefits.

New coders, especially, need to avoid falling off the deep end.

## Focusing on data structures and algorithms too early is a mistake

Let’s be realistic.

You can solve most coding problems without any deep knowledge of algorithms and data structures. Beginners need to focus on learning syntax and getting proficient at translating ideas expressed in a human language into code. You don't want to spend all of your energy on something with little immediate impact.

![People in a row boat stuck on a rock. The captain says "What do you think the most efficient way around this rock is?" One of the rowers responds: "Maybe we should just learn how to row first."](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5l4tysixsb0gtgompps.png)

But here’s the rub:

## Ignoring algorithms and data structures is risky

You could end up with your hands tied.

You may write code that works fine in small settings but screeches to a halt on larger workloads. You have a scalability problem. Or you may become so dependent on third-party packages that you can’t solve problems that hit edge cases. You have a specialization problem.

![Person tripping over an oversized hourglass, dropping their laptop, and exclaiming "Where did THAT come from?"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lakoebewtxlvx2bo9bkn.png)

Not everyone that drives a car needs to be a mechanic, though. So how do you know it’s time to take the plunge?

## Sometimes data structures and algorithms are crucial

Will your code need to:

- Scale to millions of users?
- Process enormous amounts of data?
- Run on a system with tight memory constraints?

In each of these scenarios, data structures and algorithms are vital. Not because you’ll need to write everything from scratch — although, you might — but because you’ll need tools to evaluate and compare solutions. For some projects, it can be the difference between success and failure.

![Man working on a computer with a screwdriver saying "Time to dig in!"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vu4eodg6onrmffjv3cj1.png)


But there's another reason to learn algorithms and data structures.

One that *every* coder should know:

## Algorithms and data structures are beautiful

One of my favorite quotes about art is from the English painter David Hockney:

> Art has to move you, design does not, unless it’s a good design for a bus.

A good algorithm is a work of art. The ingenuity of its inner workings, the cleverness with which it skirts constraints, can elevate an algorithm from the mundane to the downright magical.

![A group of people viewing an "algorithm" in a museum. The guide says "This one is over 2300 years old and is still in use today." One person in the group says: "Whoah!"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsf7d3o37egtfoujynka.png)

Yes, studying algorithms and data structures may be necessary for your career.

Then again, it might not.

But not everything worth learning has to be immediately useful.

---

Here are some of my favorite books on algorithms and data structures:

**For the curious beginner:**

- [*Grokking Algorithms*](https://www.manning.com/books/grokking-algorithms) by Aditya Bhargava
- [*The Recursive Book of Recursion*](https://nostarch.com/recursive-book-recursion) by Al Sweigart

**For folks who want to dig deeper:**

- [*Advanced Algorithms and Data Structures*](https://www.manning.com/books/advanced-algorithms-and-data-structures) by Marcello La Rocca
- [*A Programmer's Guide to Computer Science, Vol. 1*](https://www.amazon.com/Programmers-Guide-Computer-Science-self-taught/dp/195120400X) by Dr. William Springer
- [*A Programmer's Guide to Computer Science, Vol. 2*](https://www.amazon.com/Programmers-Guide-Computer-Science-Vol/dp/1951204042) by Dr. William Springer

**For folks who want all the details:**

- [*Introduction to Algorithms, 3rd Edition*](https://www.amazon.com/Introduction-Algorithms-fourth-Thomas-Cormen/dp/026204630X) by Thomas Cormen, et al

---

**Become a better coder in 5 minutes.**

One email, every Saturday, with one actionable tip. Always less than 5 minutes of your time.

[Subscribe here](https://davidamos.dev/curious-about-code-newsletter) →