Welcome back to Introduction to Data Structures in Go! As I have promised, we will look at a special application of stacks. Specifically, we will explore how to convert infix expressions to their postfix equivalents. Postfix notation may not seem intuitive at first, but after following this post, it will become much clearer. A brief primer “Jacob, it’s been a whole week since your last post. I don’t remember what these are.
Welcome back to Introduction to Data Structures in Go! Today, we will look at stacks. Stacks are pretty intuitive to understand and have many different uses. It will also come up a lot in coding interviews because its properties can lead to many cool applications. What is a stack? Stacks are data structures that follow the LIFO principle. That is, anything that goes in last will come out first. Imagine a stack of plates.
Welcome to my new series: Introduction to Data Structures in Go! We will start this series with a post about linked lists. If you are a student majoring in computer science, you probably have run into these in your class. Not only are linked lists a part of the CS curriculum, but are also a very popular topic in coding interviews, so it is desirable to have a solid grasp on this topic.
Welcome back to my tutorial! Last time, we set up an instance of the PostgreSQL database and connected it to our backend. This time, we will use the database and learn how to query it. A quick intro to SQL databases Although we have set up the database connection, chances are that you still don’t understand how a database works. Is it like a file explorer on my computer? How does it store data?
Welcome back to my guide, A Gentle Intro to Golang Web Development. Last time, we looked at how to write handlers for our web app. Now that we know how muxes and handlers work, it is time to use a more sophisticated tool. While Go does have an amazing net/http package, there are certain features that gorilla/mux provides that make our lives easier. Without further ado, let’s get into part 3.
Welcome to part 2 of my ongoing series, “A Gentle Intro to Golang Web Development.” I hope you enjoy it! Last time, we took a look at muxes. We know that they act as routers that route requests based on matching endpoint patterns. Now it’s time to look at how the requests get handled. Handlers, what are they? Handlers are objects that “handle” HTTP requests. All handlers implement the Handler interface shown below:
Welcome back to A Gentle Intro to Golang Web Development. Last time, we learned how to use gorilla/mux. This time, we will learn how to set up a database and connect to it. Let’s get started! Start with why It’s important to understand why we need a database. A database connection is necessary for most web apps because there needs to be a way to persist data reliably. We could create a struct and store the data there.
“Engineers are bad at naming things.” This holds true for a lot of things. Weird terms, buzzwords, ten different names for the exact same thing… the list goes on and on. It’s a bit embarrassing to admit, but I think one of the most annoying parts of learning Go was how there were jargon and terminologies I had to get used to. You have to go through this when you don’t know anything in the beginning and decide to dive in headfirst into a new topic.
If you are like me and want to learn backend development, you probably came across JSON handling at one point. JSON is a very popular format for transferring data between the frontend and the backend. Because it is such an important feature in modern web development, Go adds support for JSON in its encoding/json package. The problem is that there isn’t only one way of doing things. If you have watched a couple of tutorials in the past, you may have noticed people using different functions to handle JSON.
Sorting is a popular topic among developers. It is one of the most crucial algorithms in computer science because many important algorithms rely on sorted arrays. For example, a binary search algorithm is commonly regarded as one the fastest way to search for something. However, for it to work, we need to provide a sorted array. I am not going to delve deeply into sorting algorithms here, because it is out of the scope of this post.