Check out a free preview of the full Basics of Go course

The "The History of Go" Lesson is part of the full, Basics of Go course featured in this preview video. Here's what you'd learn in this lesson:

Maximiliano provides a brief overview and history of Go including its connection to Golang. The discussion highlights the three main goals of the Go language: ease of coding, efficient compilation, and efficient execution.

Preview
Close

Transcript from the "The History of Go" Lesson

[00:00:00]
>> So Go was created by Google in 2011, okay? It's a language created completely from scratch. So it's not based on C or Java or C Sharp, it was created from scratch. It's open source, and it's not a Google's product. So it was created by Google, for Google.

[00:00:22]
The idea was to create a new language and to fill a gap that Google was feeling that the market had at that time. And it's not that Google's product, meaning that they don't have like a marketing team or something like that. For example, there are other open source powered by Google languages or frameworks that are products of Google, for example, Angular.

[00:00:45]
Angular is actually a Google's product. For example, on Google IO, you will typically get updates on Angular, but that's not the case for Go. So Go, It's an open source project separated from Google. But of course Google is investing money in developers and the open source community to keep that language evolving.

[00:01:05]
As well as other companies that are also doing the same thing, okay? So it's multipurpose, so when we were introducing the course, we were saying, okay, what's Google for? It's for the back-end. Well, actually, it doesn't have any specific purpose. We can actually use it for many things.

[00:01:24]
In these sort of things, it's kind of similar to Python. When you say, okay, Python is multi-purpose as well. JavaScript is more focused, okay? Originally was front-end, yeah, you can do back-end. But you can do other stuff, but it's not actually prepare for some other stuff. For example, if you wanna do windows applications, which I'll skip, can you?

[00:01:45]
Yes, you can. There are some notch IS libraries that will let you do that. The same for PHP, but it's like not the idea, okay? The language was not created for that. It's multi platform, so the code that we compile, I'm adding that word right now so we are compiling the code the code that we compile is actually multi platform.

[00:02:06]
So it works on Windows, on Linux, on Unix, On Mac OS, and it can include other targets. I will show you the full list in a second. It used to have naming issues. Actually, it's kind of the fourth language in history with the name Go. So it's not the first one with the name Go.

[00:02:33]
So when Go appeared, we're talking about more than ten years ago, we had the problem. Because, yeah, to be honest, for the three Go languages that were at the time, two were kind of deprecated. One is from the 60s, so it's kind of the origin of programming, so it wasn't a big deal.

[00:02:53]
But there was another one that was called Go with an exclamation mark. It was a niche anyway, but it wasn't still there, okay? But yeah, it's Google anyway and they say, well, yeah, we're Google, we are going to name that Google. We're going to name this Go, and they did that.

[00:03:11]
Yeah, the creator of the other Go complained about the name but anyway, we are here. Gut there is something important in the Go community or the Go ecosystem, and that's that last thing you have there it says Golang. Not sure if you have heard about Golang, so what's Golang?

[00:03:33]
Actually because there was another language with the name Go, when Go started to get into the devs community, we had a problem when, for example, we were searching on the web. So if you were searching how to debug Go, how to parse JSON or XML with Go. Most of the references available at Google were actually from the other Go languages, the previous one not for this one.

[00:04:04]
And the website, the website for go, originally was Golang, Golang.org, I think. Because at the time, a lot of languages were actually using that pattern for their domains. So that's another google powered language was .lang. So, their websites were the name of the language, Lang. So, that's why for a while, I may say for five, six years, we were using Golang as the name of the language.

[00:04:38]
So, when you were searching for something on the web, how to parse XML in Golang, that was the way to do that, okay? So you may still hear that today, but it's not yet a pattern. But just in case, okay? You hear about Golang, it's just the same language.

[00:04:58]
So the creators of Go are these guys Ken, Rob and Robert. That the only important part that I wanna mention here is that they have a lot of experience working with languages and with low-level stuff. So Ken has been working in the B and C languages. B was another language before C, actually.

[00:05:19]
He also worked on Unix and UTF-8, that's a character in coding system that we are this is standard today. The same for Rob, that also works at Google, and Robert has been working with Java on the Java built on machine. So that's why the committee was so excited when the language appeared, okay?

[00:05:39]
Because it was coming from lot of people with experience doing languages. Go appeared in the development space in, let's say, in an era where a lot of languages appeared. So after the 90s, we have have in a slow process of adding new languages. So actually we thought that we were done with languages, okay?

[00:06:03]
We had Java, C Sharp, JavaScript, PHP, we have C, C++, and we didn't need more. We didn't want more languages for a while, like for a decade. Between 2008, 2012, 2013, we saw a lot of new languages appearing in the market and Go is one of those. But also we have Dart, we have Kotlin, maybe that's younger.

[00:06:34]
But Kotlin, Swift, Hack, that that's a language where, actually Facebook is running on Hack, that is kind of an evolution of PHP. But anyway, it's part of a moment in history where a lot of new languages have appeared. When we realized that the kind of apps that we are doing these days are not the same that the kinds of ads that we were doing in the 90s or the 80s.

[00:07:00]
So the needs are different. So now we have, for example, the web, internet, that in the 90s, it was just starting and it wasn't actually the most important part. So when Java appeared, the web wasn't actually a big thing, it was there. But yeah, we weren't we weren't actually creating apps for the internet.

[00:07:24]
So then that means that the original idea of Java, I'm thinking Java but it can be other languages as well, wasn't actually for covering the needs that we have today. So now we are starting from scratch. So why Go? The idea is to create a language that is easy to code, and it's easy to code means also easy to read.

[00:07:50]
That when we look at the Go code, it depends on the developer always. But at least the language has no obscure things that makes your code harder to read, okay? That some languages have. When you read the code, it's like, it's difficult to follow, you need to debug that, because it's complicated.

[00:08:16]
Also, easy to code includes the idea that developers shouldn't be making a lot of decisions about how they write their code. And that that part will give us a lot of restrictions. And mostly if you're coming in from other languages. You will feel yourself in jail sometimes, okay?

[00:08:42]
But that's because the idea is we don't want freedom here, we want everyone in the team writing the same code, okay? Yeah, and sometimes the language made some decisions that you may not like. And you need to get some time to get used to, okay? I'm not saying that you will never like that, but with time, you get used to that and you get to understand the advantage of that lack of freedom.

[00:09:11]
Anyway, so that's one part. So an easy to learn, easy to use, easy to read language. The other part is efficient compilation. One of the problems today that we have is that four languages that are compiled, and by the way, that's Java, C Sharp, of course we have different kinds of languages, and we'll get into that in a minute.

[00:09:33]
But some of you here are no JS developers or JavaScript developers, is JavaScript being compiled? I have a face saying something like this, so I guess that's a no. Actually it is being compiled these days. We are not compiling the code, so developers are not compiling the code.

[00:09:57]
But browsers or engines or the known JS engine, it's actually compiling the code before executing the code. So there is a still there in compilation process. And actually, in web performance, when we're talking about front-end web performance, that's one of the most important problems we have today. The time that it takes to compile, parse and compile JavaScript that you have from React or Angular.

[00:10:21]
It's a huge JavaScript library, okay?. The problem that we have, not maybe on front-end, but on large systems that you are doing back-end or you're creating systems for a financial company. Is that with Java, with .net, with any other language or a lot of languages that we have out there.

[00:10:44]
When you have a large application with, I don't know, 200 developers working on it, different modules, different packages. Every time you need to compile your app it takes minutes, if not hours. Which is a problem for large companies, they cannot wait ten minutes, 15 minutes, four minutes. Every time a developer is making a change to make to compile, okay?

[00:11:10]
So because we are getting bad at compilation performance, we are adding a lot of dependencies, that was a problem. So to make better apps, we need to be faster in compiling and deploying. And also we need efficient execution. So we actually need to scale easily our app so it doesn't matter if we are creating an app that will be serving ten users or 10 million users, we should scale properly.

[00:11:43]
And for that we need efficient execution, okay? So when Google started the project, the Go Project, they realized that they didn't find a language that was actually having the three characteristics, okay? So they say, for example, Python and JavaScript, they organize that between yeah they're easy to code.

[00:12:05]
They might be pretty good at compilation because you don't compile it, or it's pretty fast. But they don't have efficient execution. The dynamic nature of, useless typing, for example, in those languages and other things that built on machine that they have, make things not as fast as they should, at least for high scalable solutions.

[00:12:33]
Java, on the other side, it was efficient, it was okay for compilation but they thought that it's not easy to code. So setters, getters, listeners. So everything is a lot of code, they mention the idea of bureaucracy. There is a lot of bureaucracy around writing code, okay? And C++ is efficient, but yeah, efficient in execution, that's why a lot of games and operating systems are written in C++.

[00:13:07]
But it's not easy to code, pointers and all that stuff, it's not efficient in compilation. So, of course, what they say is, yeah, we have a Go and Go it's there in the middle trying to fulfill the three goals. And have these three goals in mind for the rest of the day.

[00:13:33]
Because sometimes you will ask yourself why they did this in this way? If you will feel like there are some weird things going on. And the answer is always these goals, because that was the only way to comply with the three goals. Is yes, of reading and coding that thing and efficiency in terms of compiling execution.

[00:13:59]
So maybe you were asking why we don't have X. Let me tell you one bit. Initially, it's like a big bad news, we don't have classes here. We don't have objects in Go, so why? Well, they found that yeah, it's not complying with the three goals. So we have an alternative, we have another way, another paradigm.

[00:14:28]
Can we emulate objects? We can do some some things and we will see how. But we need an efficient way, an efficient way compare with directly using objects as in Java or as in JavaScript.

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