I recently had a ticket opened on my team’s backlog board requesting the ability to bypass our API’s caching system. For context, our front-end team uses my team’s API to make fairly heavy requests to ElasticSearch, and one of the features of our API gateway is to cache the results of heavy aggregations for ~30 seconds. It turns out, every once in a while they need to run two of the same query within the ~30-second caching window and want an updated result set.
What is the “defer” keyword in Go? In the Go programming language, defer is a keyword that allows developers to delay the execution of a function until the current function returns. What throws some people off is that the deferred function’s arguments are evaluated immediately, but the function itself doesn’t fire until the wrapping function exits.
“Why learn JavaScript?” I asked my sister when she was in college and starting to pick up the fundamentals of JavaScript. “Isn’t it ancient? Do people still use it?”
Keeping track of time in code has long been every developer’s nightmare. While no language or package manages time perfectly, I think Golang does a pretty good job out-of-the-box. This full tutorial should answer ~90% of the questions you’ll have about time management in Go.
Perhaps you’ve heard of the fabled 10x developer (or 10x engineer) - the one on the team that’s 10x as productive as their average colleague. While many, including myself, doubt the existence of such people, I do think there are meetings that are 10x as productive as the average meeting. My goal in this article is to break down their properties so we can have 10x fewer meetings.
The Go standard library makes concatenating strings easy. Concatenation is just a fancy word for adding strings together to make a larger string. For example, if we concatenate "hello", " " and "world" we’d get "hello world".
These two coding languages duke it out - but who’s the winner? In a world where the ability to write any code at all is a tremendous advantage, often the biggest problem coders face is knowing which language to start learning, rather than whether to learn one at all. There are different languages for just about every purpose you could think of. Of those popular coding languages, programmers often face an intense battle of Golang vs Python. (The official name is Go, but the website is Golang.org, so programmers typically refer to it as either interchangeably.)
As a language designed for the web, Go provides extensive support for working with JSON data. JSON (JavaScript Object Notation) is an incredibly popular data exchange format whose syntax resembles simple JavaScript objects. It’s one of the most common ways for applications to communicate on the modern web.
Boot.dev’s web app that hosts all of my coding courses is a single-page application written in Vue 2, with plans to migrate to Vue 3 soon™©®. In the meantime, I happened across a cool new tooling app called Vite that promised a few things that caught my attention.
Go has a powerful standard library that makes string manipulation easy right out of the box. One of the functions I use most often is the strings package’s Replace() function. strings.Replace() returns a copy of its input string after replacing all instances of a given substring with a new one.
An enum (short for enumerator), is a set of named constant values. An enum is a powerful tool that allows developers to create complex sets of constants that have useful names and yet simple and unique values.
I can’t begin to tell you how often I split strings in Go. More often than not I’m just parsing a comma-separated list from an environment variable, and Go’s standard library gives us some great tools for that kind of manipulation.
Too often I neglect the idea of UX design in backend work. The goal of user experience design is to give users a product that’s easy to use. In the world of front-end development, that typically means making it obvious how to navigate your site, using commonly-understood icons, or implementing well-contrasted colors for foreground and background, making your site easy to read.
For loops are a programmer’s best friend! They allow us execute blocks of code repeatedly and iterate over collections of items. In Go, there are several different ways to write one.
Sorry it took so long for me to get this one out! Data Structures and Algorithms 2 was just released, and I’m excited to let you all get your hands on it, even if you’re just auditing it for free! The more advanced material takes quite a bit longer to produce, I wanted to triple-check to make sure I got everything correct and that I’ve presented it in a way that makes it easy to understand.
I’ve noticed that bugs introduced into an existing code base are often due to poor variable naming more than one might suspect. For example, a developer uses a rateLimit variable expecting it to be denominated in seconds while it represents minutes, resulting in a 6x slower schedule. Another developer expects dbConnection to be an open database connection, but instead, it’s just the connection URI.
When you’re in a position of wondering, “Is a coding bootcamp worth it?” you should look at several factors. Coding bootcamp costs, on average, around $13,000. This holds true no matter if you choose to attend coding bootcamp in person or online, though there’s a lot of variance in how much coding bootcamp costs, ranging from $3,000 to $20,000 depending on the language, the length, and who’s running it.
Changing majors is a tale as old as time. A degree that would normally require four years to complete can quickly turn into a more expensive endeavor that takes five or six years for a student that can’t decide what they want to study. The interesting thing about programming jobs is that they don’t require a degree at all, but if you at least complete an associate’s degree, you’ll have a better chance of landing that first job.
When I was just getting into coding, I was very disorganized. I would create a new text file in My Documents, work on it, never create a Git repository, accidentally delete it later, you get the idea. Nowadays I’m quite the opposite. To be honest, the thing that made me get my act together was the quite unpopular and now deprecated GOPATH that early versions of Go required developers to work in. I think it was the right move to not force that organization as a requirement, but I actually quite liked the method personally, and still use a version of it to this day.
Last weekend I did a major revamp of boot.dev’s payment strategy, after toying with the first version since I launched in the summer of 2020, as it turns out, the microtransaction (gem) strategy didn’t work out to the benefit of my students, nor to the growth of boot.dev. As a result, I’ve flipped my funding strategy on its head and decided to make all of boot.dev’s content free to audit. Let’s take a look at exactly what that means.
There are two main options to get a programming certificate online - online courses and universities. There are two ways to get a programming certificate online - universities and online courses. In the simplest possible terms, a programming certificate is something that lets you walk up to an employer and say, “Hello, yes, I know how to SQL. Here’s a piece of paper that proves it. You should hire me.”
So you might already know that the amqp package is awesome and you can get up and running with just 40-50 lines of simple code. Unfortunately, the bare-bones amqp library doesn’t handle a lot of the stuff you probably wish it did, things like reconnecting logic, the spawning of threads, queue and binding boilerplate, and flow control.
“Software engineer” has become a ubiquitous term for people who write, deploy, architect, or sometimes even simply test code. In reality, I think there are two classes of “software engineers”; those who understand computer science well enough to do challenging, innovative work, and those who just get by because they’re familiar with a few high-level tools. The laziness with which the tech industry has adopted the term “software engineer” has made it harder for us to distinguish between the two.
Functional programming is a way to write code where programs are created strictly through functions. Functional programming has gained quite a bit of traction in recent years among the development community, mostly because of the benefits it provides.
The journey to becoming a gainfully employed software engineer can feel long. The good news is, you can learn smarter not harder. Apply these eight tricks and you’ll be learning to program a lot faster than the average bear.