Computer Science, Simply Explained.

Introduction

⭐️️ amy ⭐️️
codeburst

--

Contents

I write code for a living and I get asked all the time “Did you learn to code in school?”, and the truth is: not really. In school, I learned Computer Science (algorithms, data structures, forming logical arguments . . . in other words, theory) but at the time, I was more interested in building websites and apps than the nuances between quicksort and mergesort. Just like how you don’t learn music theory before picking up a guitar, computer science concepts are hard to grasp when you’ve never coded before. You play around with the guitar first, and later on the desire to learn music theory develops.

Now that I’ve been coding professionally for a couple years, I’ve developed a renewed interest in the value of computer science. This series is about diving back into the topics I learned in school, and explaining them in a way that is easier to grasp than, say, a textbook written in the 1980s. The concepts I discuss will be useful for everyone from software engineers like myself who want to brush up on their knowledge to non-techies who want to learn a little bit more about commonly used terms like algorithms and data.

The Basics

Data Structures

One of the primary functions of computers is to store information, also commonly referred to as data. Data structures are used to handle groups of information that relate to each other. There are various data structures to accommodate the different ways we might need to access information.

Consider a library of books. The books are organized in alphabetical order. When we need to find a specific book that starts with the letter “M”, we know to look somewhere in the middle of the bookshelves. If someone wants to check a book out that is currently checked out, they may be put on a list of names of people who want to check out that book. When the book is returned, the first person who was added to the list will be the next person to check out the book. The bookshelves and the list of names are both examples of data structures.

Algorithms and Logic

Algorithms are instructions on how to manage information. Algorithms can be used to search for a specific piece of data, add or delete data, and display data that is stored in a data structure.

Using the first example above, if you were training a new librarian on how to find a book on a bookshelf that starts with the letter “M”, the instructions you’d give them would be an algorithm. Similarly, the instructions you’d give them to check a book in or out of the library are also algorithms.

Basic algorithm for checking a book back into a library

Step 1: Make a space for the book on the shelf
Step 2: Put the book onto the shelf

Some algorithms are more efficient than others. For example, a librarian would not want to look through every book starting from the “A”’s to find a book that starts with an “M”.

To perform algorithms like these, we will always need to use some logic. Using logic is important because an algorithm may need to follow different sets of instructions based on the conditions of the data.

Algorithm for searching for the book Macbeth using logic

Conclusion

These are the fundamentals of computer science. In the future, I’ll discuss them more in-depth and explain how they can be useful in a variety of scenarios. My goal here is not to reinvent the wheel, there’s numerous places that discuss the exact same topics, but to present the information in a way that makes sense. I aim to break these concepts down into small snippets that are easily digestible and only require a few minutes of your time.

--

--