Check out a free preview of the full Build Go Apps That Scale on AWS course

The "Why Use Go?" Lesson is part of the full, Build Go Apps That Scale on AWS course featured in this preview video. Here's what you'd learn in this lesson:

Melkey shares a brief history of Go, a statically typed, compiled language. Go is beginner-friendly and versatile, making it an attractive choice for start-ups and large organizations.

Preview
Close

Transcript from the "Why Use Go?" Lesson

[00:00:00]
>> Let's get started with Go here. There's a lot of cool things that Go offers. And I've been using Go professionally for about three years at Twitch. I joined, I didn't know anything about Go. Kind of put me in a deep end, started writing it, was completely lost.

[00:00:18]
I came from Python, very different language, just this conceptually like even the compiler portion. I was just like what what do you mean I can't run this script, what it is? So, Go really changed my thinking of how to write software. So I'm very passionate about Go, that's why I like to make videos, that's why I like to make a course about Go.

[00:00:38]
But for those who don't know, or those may be new, what is it? It's a statically typed, compiled program language. It's very different, it's very fast, it's very efficient. I think the typing system Go offers, it's like the best typing system. And I know I'm gonna probably catch some flack, from other people, for other languages, typescript.

[00:01:01]
But I think Go really has everything you truly need without losing your mind and spending as much time writing application code to writing your type safety kind of surface for that code. So I think Go just does it right. It's a compiled programming language, so it's not interpreted, it's trebly fast.

[00:01:20]
And then there's the who. And I actually wanna hyper-focus on the who for a second. It was designed at Google by a very smart group of individuals. Rob Grazmer, Rob Pike, and Ken Thompson again sorry if I'm mispronouncing any names, plus a lot of other individuals. They made this programming language at Google and the history of it isn't that these individuals came together and they said, you know what we need?

[00:01:50]
Another programming language, that's what the world is missing. That's not how Go originated. Go originated based on the mantra of how can we allow individuals to write software easier. That is the TLDR, the Gold Star of Ghost Mission. Because, this group of individuals are very smart and they're rewriting C.

[00:02:17]
Back in 2005 I googled, writing C in 2005, there's not a lot of resources you will have to go to a textbook probably find something, go to forums on the internet. So these individuals really knew how software is written at a low level. But they realized, when they got new people joining the team, new junior engineers, new interns, they couldn't really write C all that well.

[00:02:46]
There were some gaps in knowledge, they weren't as efficient with C. And so the team was kind of scratching their heads, well, we need them to write essentially much better software, but they just don't have that breadth and that depth of knowledge with C. So, that's how Go originated from.

[00:03:03]
It was designed to be a language that allows people to write software much easier. And it abstracts a lot of the complications that C introduced or C has, with its garbage collecting, with its system of structs and interfaces. With, a lot of different things concurrency, it really did make writing Go and it really changed the period of how to write software efficiently and much quicker.

[00:03:32]
And then there's the why, right? Why should you learn Go? Why should you spend your time allocating to Go, why should you try to convince your manager team to, maybe we should migrate to Go, maybe we should write this new project using Go. And it's known for its simplicity and efficiency and in strong support for concurrent programming.

[00:03:51]
I just wanna say that concurrency is not parallelism. Rob Pike has an excellent talk describing that, concurrency is different concurrency is how you can run multiple things differently in the same thread. So you don't need to, it's not writing and executing the same thing in multiple processes, it's just you have one, you have the same resource but you're doing multiple things at once.

[00:04:13]
So concurrency allows for a lot of strong code to be used, a great example is maybe cleanup code. At the end of your execution, if you have something spun up, you can have a concurrent Go routine, which is a very light thread to clean up your code at the end.

[00:04:30]
So, that's tells you what, who, and why with Go. Obviously, I'm a big supporter of it, I try to consume as much Go content as I possibly can. And it's really again coming from Python or even JavaScript that time, Go introduce things to me that just made me a better software engineer, I still write bad code, okay?

[00:04:51]
I still write bad code, but it makes me think in a different way of how I can go about writing said code. So hopefully you all feel the same. But yeah, so why should you use Go? For a lot of people there's different reasons. But I think really the biggest selling point to me is the versatility.

[00:05:11]
When you think of Go, you probably think it's a back-end programming language. I can use it for the back-end, I can write an HTTP server or an RPC, GRPC server, or I could make a CLI. Yeah, I mean you totally can, you totally should. That's the bread and butter of Go.

[00:05:29]
That's a really good application of it. But we're seeing nowadays, Go is being used in a variety of different applications, even front-end stuff. Now Go natively has a lot of great support with its standard library, arguably has the best standard library. So you're not gonna have a huge dependency tree, you're not gonna have a package JSON with like 40 different dependencies all with their specific version.

[00:05:56]
If you change one, it breaks another one. You rarely see that if ever in Go because a lot of time, you can write literally everything from the standard library. It offers everything you need. And on the topic of the front-end portion, Go now plays really well with new upcoming technologies.

[00:06:16]
HTMX, even the package built in Go ecosystem temple, where you can generate these HTML files, render them in a dom. And then actually play around with web components, web UI elements, and keep all that state and Go as your back-end. So really you can use, Go for a lot of different things nowadays.

[00:06:39]
I bought a lot of cool things with Grue, I'm gonna showcase one. So it's very very versatile and it's beginner friendly, not from the perspective of I've never touched programming and I'm interested, but I've written PHP code for 510 years and I want to use Go. That's also a beginner friendliness, because it's great for those new to programming or those who wanna switch, because going from zero to 100 and Go is super super easy, super fast.

[00:07:11]
Going from zero to 100 and language like rust, that's a whole different beast and that plays into this third point of jobs. More and more companies, big tech and startups are choosing to adopt Go. And it's not because of its incredible performance, which it is very performant, but because of that beginner friendliness, because that learning curve.

[00:07:34]
You can basically get developers from different areas of programming. You can say, hey we use Go and they'll ramp up in two weeks. You use Go full-time for two weeks, you will have enough knowledge where you can start building and reading the code. And I think that's what a lot of companies are recognizing.

[00:07:51]
And this isn't the case for everyone. A very popular example of a company going the other way was actually in 2021, Discord. Discord went from Go to Rust. So this isn't a blanket statement, right? I don't want you to be like, Melkey said there's gonna be a pop-off in jobs.

[00:08:06]
I think more and more companies are adopting it seeing the potential. And so I think it's a worthy investment at this point, if you are looking to look for new programming language to kind of broaden your horizon. And obviously, that's gonna increase the number of Go jobs. But, like I said, when you think of Go you think of back-end development.

[00:08:25]
There's also that core application of cloud deployments, right? Kubernetes and Docker, those are built with Go. So there's so many things and so many different jobs that will just say, hey we want to be a cloud engineer. But really you look in the fine print, they're looking for a Go developer because of how well it plays with that environment.

[00:08:44]
And arguably, my favorite is the velocity. I'm a big fan of shipping code. I come from this more practical mindset where I do believe in running good, clean software. But I don't really like the idea to spin my wheels for two weeks deploying something it doesn't work. I like let's iterate on it, let's deploy a version MVP.

[00:09:08]
Let's get a tracer bullet out of the way. Deploy that, see how it works? Do we like it? Thumbs up or let's improve. We totally miss something, all right cool, tear it down improve it, let's iterate that way. So, Go gives us that fast velocity to build applications, and that just translates to writing code faster.

[00:09:24]
I mean, like I said, the team at Google, that's what they wanted. They wanted people to write code faster, but not just write stuff in an editor and send it off, but actually write good stuff. And so, they realized they can't only depend on those engineers, they're going to depend on themselves to make something those engineers could use to deploy code faster.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now