I was recently working on a lesson about pointer performance for Boot.dev’s Golang course when I found myself repeating some advice I’ve given many times before.
Recently I saw an interesting post on Reddit: “I would like to be more full-stack,” user Fenugurod said. “I was studying Tailwindcsss and I’m pretty sure I can create really nice UIs with it. But what do you guys think about web development with Go? Most of my friends simply say to embrace the JS ecosystem with Nuxt or Next and use Go simply as an API.”
Go is built for grug brained programmers like me. grug brain developer not so smart, but grug brain developer program many long year and learn some things although mostly still confused
Go has hard opinions about how you should style and format your code. Setting up your VS Code environment to enforce the standard linting and formatting rules can save you a ton of time.
“Guys, I’ve got an idea. What if we could design a language that’s easy to read like Python, but fast? That has a slim feature-set like C, but is good for web development? That’s compiled like Java, but doesn’t need a VM?”
Put simply, Golang is best for the backend side of a web application or website. There are many reasons that this is the case, so let’s dive in, but before we do, let’s cover some quick definitions.
If you’re rounding a floating point number in Go, it’s most likely you want to format it in a string. Use the built-in fmt.Sprintf() function.
Golang was released in 2012, making it a relatively new language when compared to competitors like Python, which was released nearly two decades prior, yet it’s managed to stay ahead of the game as not only a coveted language by employers, but also loved by programmers.
Generics in Go have been released with Go 1.18! This is one of the most eagerly-awaited features since the release of the language. Many devs have gone so far as to say Go’s previous lack of generic types made the language too painful to use at all. Let’s dive into what generics are, why you might use them in your own projects, and how they work in Go.
In 2009, the computer science world was blessed with two powerful tools: Golang and Node.js.
Golang and C# offer a unique mixture of similarities and differences, having both been inspired by the same language, C.
Scala and Golang are newer languages, only coming onto the scene after the turn of the century, but in that time they’ve managed to become two of the highest-paid languages for developers, with the industry benefiting from their fresh creation.
Golang (or Go) and Java offer an interesting comparison because despite their wide differences, there are also key similarities in how and where they’re used by programmers.
In 2007, frustrated by some of C++’s inefficiencies and overcomplicated nature, and desiring a programming language designed specifically for multi-core processors and effectively managing large projects, three Google engineers, Robert Griesemer, Rob Pike, and Ken Thompson, designed the Go language.
Needing to be a math genius to learn to code is a thing of the past. High-level programming languages offer an alternative to low-level machine code, which makes coding more accessible than ever. Let’s dive into how Golang, a modern higher-level language, matches up to C++, a tried-and-true low-level language. We’ll cover the most important points like which language is more performant, which is easier to learn, which results in cleaner code, and which programming methodologies guide their respective designs.
Quicksort is an efficient sorting algorithm commonly used in production sorting implementations. Like Merge Sort, Quicksort is a divide-and-conquer algorithm. As the name implies, Quicksort is one of the fastest sorting algorithms, but you have to pay attention to detail in your implementation because if you’re not careful, your speed can drop quickly.
Insertion sort builds a final sorted list one item at a time. It’s much less efficient on large lists than more advanced algorithms like quicksort or merge sort. Insertion sort is a simple algorithm that works just like you would arrange playing cards in your hands. A slice is first split into sorted and unsorted sections, then values from the unsorted section are inserted into the correct position in the sorted section.
Merge sort is a recursive sorting algorithm and, luckily for us, it’s quite a bit faster than bubble sort. Merge sort is a divide and conquer algorithm.
Bubble sort is named for the way elements “bubble up” to the top of the list. Bubble sort repeatedly steps through a slice and compares adjacent elements, swapping them if they are out of order. It continues to loop over the slice until the whole list is completely sorted.
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.
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.
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.
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.