Boot.dev Blog
How to Get Consistent Line Breaks in VS Code (LF vs CRLF)
by Lane Wagner - Boot.dev co-founder and backend engineer
Have you ever had the problem where you submit a pull request and the diff is much larger than it should be? Maybe the code looks identical, but GitHub tells you it's completely different.
Simple Setup - Vue Linting in VS Code
by Lane Wagner - Boot.dev co-founder and backend engineer
I'm a gopher by nature, so I expect consistent styling and linting in my codebases. More importantly, I don't like to think about styling. I like to type haphazardly and then have my editor apply styles automatically on save (ctrl+s, cmd+s). If you are the same way, hopefully, this will help you in your next Vue.js project.
Go-CoNLLU - Some Much Needed Machine Learning Support in Go
by Lane Wagner - Boot.dev co-founder and backend engineer
Python is commonly seen as the AI/ML language, but is often a dull blade due to unsafe typing and being slow, like really slow. Many popular natural language processing toolkits only have Python APIs, and we want to see that change. At Nuvi, a social media marketing tool, we use Go for the majority of our data processing tasks because we can write simple and fast code. Today we are open-sourcing a tool that has helped make our ML lives easier in Go. Say hello to go-conllu.
Go's WaitGroup vs JavaScript's PromiseAll
by Lane Wagner - Boot.dev co-founder and backend engineer
In applications that are i/o heavy, it can get clunky to synchronously execute high-latency functions one after the other. For example, if I have a web page that needs to request seven files from the server before it can show the page, I need to asynchronously fetch all those files at the same time. The alternative of making each request one at a time will take much too long. This is where JavaScript's PromiseAll and Go's WaitGroup come in.
How to Sort a Slice in Go
by Lane Wagner - Boot.dev co-founder and backend engineer
Sorting is a common task in programming, and for that reason, most languages have a default sorting algorithm in their standard library. Go is one such language. Go has gone about providing sorting functionality in one of the most elegant ways possible, via an interface.
Using Concurrent Subscribers With RabbitMQ in Python (pika)
by Lane Wagner - Boot.dev co-founder and backend engineer
It's a fairly common scenario to subscribe to a Rabbit queue and process messages before acknowledging receipt. The pika package for dealing with RabbitMQ in Python however is only single-threaded out of the box. If we want to make a network or database call before each acknowledgment our subscribers can get really slow.
Don't Go To Casting Hell - Use Default Native Types in Go
by Lane Wagner - Boot.dev co-founder and backend engineer
Go is strongly typed, and with that, we get many options for simple variable types like integers and floats. The problem arises when we have a uint16, and the function we are trying to pass it into takes an int. We find code riddled with int(myUint16) that can become slow and annoying to read. In other words, when Go developers stray from the "default" type for any given type family, the code can get messy quickly.
How to Break From Nested Loops in Rust
by Lane Wagner - Boot.dev co-founder and backend engineer
Loops in Rust aren't the same as standard C-style languages. The syntax is different and there are some powerful options that make looping easier. First, let's go over some looping basics, then we will cover how to handle breaking and continuing in nested loops in Rust.
Variable Shadowing In Rust - "Let" Is Immutable But Not Constant
by Lane Wagner - Boot.dev co-founder and backend engineer
Let's take a look at some of the common pitfalls with the keywords let and mut. Then, we will learn how immutable != constant by using variable shadowing.
Quantum Programming 101: Backend Monitor
by Macauley Coggins - Researcher and Founder of Quantum Computing UK
In a previous tutorial we showed how you can get basic information on all quantum devices using backendoverview().
Concurrency In Rust; Can It Stack Up Against Go's Goroutines?
by Lane Wagner - Boot.dev co-founder and backend engineer
One of the primary goals of the Go programming language is to make concurrency simpler, faster, and more efficient. With Rust growing in popularity let's see how its concurrency mechanisms stack up against Go's.
Rust vs Go - Which Is More Popular?
by Lane Wagner - Boot.dev co-founder and backend engineer
Go and Rust are two of the hottest compiled programming languages, but which is more popular, Go or Rust?. I develop in Go full-time and love it, and I'm learning more about Rust recently - it's an exciting language. Let's explore some differences between the two and look at which is growing faster in the popularity polls.
Achieving Data Integrity Using Cryptography
by Lane Wagner - Boot.dev co-founder and backend engineer
Data integrity refers to the accuracy, legitimacy, and consistency of information in a system. When a message is sent, particularly using an untrusted medium, data integrity provides us with confidence that the message wasn't tampered with. For example, the SSL signature of Boot.dev provides confidence that the webpage and data coming from our servers are coming from us and not the NSA.
Range Over Ticker In Go With Immediate First Tick
by Lane Wagner - Boot.dev co-founder and backend engineer
The Go standard library has a really cool type - Ticker. Tickers are used when you want to do something at a regular interval, similar to JavaScript's setInterval. Here's an example:
(Very) Basic Intro To White-Box Cryptography
by Lane Wagner - Boot.dev co-founder and backend engineer
White-box cryptography combines methods of encryption and obfuscation to embed secret keys within application code. The goal is to combine code and keys in such a way that the two are indistinguishable to an attacker, and the new "white-box" program can be safely run in an insecure environment.
Using 'Go Generate' To Deploy Multi-Process Apps
by Lane Wagner - Boot.dev co-founder and backend engineer
In microservice architectures, it's fairly common to have a project that includes different worker types. A Makefile can be used to manage the creation of multiple programs, but the Go toolchain has a tool that can be used as well, go generate. Here are some examples of how it can be used:
What Are Golang's Anonymous Structs?
by Lane Wagner - Boot.dev co-founder and backend engineer
An anonymous struct is just like a normal struct, but it is defined without a name and therefore cannot be referenced elsewhere in the code.
Quantum Programming 101: Superdense Coding Tutorial
by Macauley Coggins - Researcher and Founder of Quantum Computing UK
Superdense coding is a quantum communications protocol that allows a user to send 2 classical bits by sending only 1 qubit.
Announcing Go-TinyTime, Go-TinyDate's Sister Package
by Lane Wagner - Boot.dev co-founder and backend engineer
time.Time is the perfect choice for handling times in Go in most cases, it even comes in the standard library! The problem is that the time.Time{} struct uses more than 24 bytes of memory under most conditions. Go-TinyTime solves this problem by restricting the available dates to the range between 1970 - 2106, and only supporting UTC timezones. This brings data usage down to just 4 bytes of memory.
Golang Conversions - Ints To Strings And Strong Typing
by Lane Wagner - Boot.dev co-founder and backend engineer
Go is a strongly typed language, which means at any point a developer should know exactly what type of value they are dealing with. For example, if we have a function that prints a string, we can't just give it an integer and expect it to work. We have to cast it to a string explicitly:
How To Separate Library Packages in Go
by Lane Wagner - Boot.dev co-founder and backend engineer
I've often seen, and have been responsible for, throwing code into packages without much thought. I've quickly drawn a line in the sand and started putting code into different folders (which in Go are different packages by definition) just for the sake of findability. Learning to properly build small and reusable packages can take your Go career to the next level.
I Wrote Go-TinyDate, The Missing Golang Date Package
by Lane Wagner - Boot.dev co-founder and backend engineer
time.Time makes dealing with dates and times in Go a breeze, and it even comes bundled in the standard library! However, a time.Time{} struct uses more than 24 bytes of memory under most conditions, and I've run into situations where I need to store millions of them in memory, but all I really needed was a UTC date! Go-TinyDate solves this with just 4 bytes of memory.
Mutexes in Go
by Lane Wagner - Boot.dev co-founder and backend engineer
Golang is King when it comes to concurrency. No other language has so many tools right out of the box, and one of those tools is the standard library's sync.Mutex{}. Mutexes let us safely control access to data across multiple goroutines.
Interfaces in Go
by Lane Wagner - Boot.dev co-founder and backend engineer
Interfaces in Go allow us to treat different types as the same data type temporarily because both types implement the same kind of behavior. They're central to a Go programmer's toolbelt and are often used improperly by new Go developers, which leads to unreadable and often buggy code.
Wrapping Errors in Go - How to Handle Nested Errors
by Lane Wagner - Boot.dev co-founder and backend engineer
Errors in Go are a hot topic. Many newcomers to the language immediately level their first criticism, "errors in go are clunky! Let me just use try/catch!" This criticism is well-meaning but misguided.
