>> Hi I'm Francesc Campoy and this, is just for-.
>> No, The Open Source Show.
>> Oh yeah.
>> Welcome back to The Open Source Show.
My name is Brandon Minnick, with me we
have a very special guest today.
You've seen him talk about Go all around the world.
You know him from his hit YouTube channel JustForFunc,
Francesc Campoy. I'm new to Go.
I've heard of it,
I know it exists,
it's the cool language,
and I want to learn more.
But first I'm kind of curious, where did it come from?
It seems like it exploded overnight in popularity.
>> Six years ago it was open sourced and before
that it was a closed source, I guess,
project internally at Google.
The whole idea was rather than writing very big servers,
with big machines, many cores,
many developers, all of that thing.
So, with Go basically what they tried to do is,
let's remove all of the fancy things and go down to
the simplest possible tool that can do the job.
That result is Go, really.
I used to write C++ and I
assumed that in order to write powerful things,
you needed a powerful language.
Then, when I start writing Go, I
realized that that was actually
pretty wrong because at the end of the day,
if you have a simple tool that is
effective, that works very well.
The good thing is that since the tool is so simple,
it actually allows you to focus on the problem
you're trying to solve rather than how you're solving it.
So, there's a lot of big projects like Kubernetes.
Kubernetes is far from being simple. But it uses Go.
The cool thing is that that allows people to
come and have to understand the concepts
of how Kubernetes works on like
pods and services and all these things,
and not having to take that much time into
understanding how that translates into Go.
Go is simple to read. That's the whole point.
>> I love it simple, yet powerful.
>> Yeah.
>> So, when we're talking about C++.
I've written some code in C++
you have to do all this memory allocation,
deallocation, there is pointers, it's crazy.
>> Yeah. >> So, how does Go manage
that powerfulness of C++ but still keep it simple?
>> In C++ you need to do all of the things.
In Go, you're not allowed to
do any of the things, that's way simpler.
You have pointers, but you cannot delete them.
There's a garbage collector that does all of the things.
You don't decide whether something is allocated on
the heap or on the stack, you don't decide.
There's many of these things that as
a C++ programmer or like
low level programming and you're like,
"How am I going to do anything with this?"
Then, you just give up,
accept the way of Go and you just start writing code.
It's actually very effective,
surprisingly and at the end of the day,
is actually around the same performance as
C++ on the memory side of things.
Last but not least is the fact
that all of this is still really fast
>> How did you get started working with Go?
It sounds like it's been around for a bunch of years,
and you've become one of the de facto experts on it.
I'd love to know how you got started.
>> I was writing C++ and I became
a C++ expert in some way.
When I decided to do something new,
I ended up being at Google writing C++.
After a year or so, I decided to do something new.
I discovered Developer Relations
as the thing which I love.
Also, since I did
my Masters on compilers and optimization,
I decided they'd be fun to merge both of them.
So, I ended up doing Developer Relations for Go.
My first job was to learn Go
and go back with feedback about the experience.
>> Looking at it through fresh eyes.
>> Yeah, exactly.
>> Amazing.
Is that where the YouTube channel JustForFunc came from?
>> I decided to create JustForFunc,
which is a YouTube channel that I've
been posting videos regularly,
for like two years.
The whole thing started because I
actually messed it up on stage once.
I apologized and I said,
"I am very sorry.
I'm going to go back to the hotel,
redo the whole demo,
and post this on YouTube."
That was the first video
ever which is Go Tooling in Action.
I think it's like over 50,000 views.
That's my most successful video so far.
Yeah, it's because I failed. Failure is good.
>> I'd love to see it.
>> Let's go, let's go watch it.
>> Let's go.
>> I've shown one way of accessing the documentation for
the current package which is right here doc,
and you can do the same thing for
fmt and see the documentation for the fmt package.
But there's better ways of doing than that.
My favorite one is go doc.
If you do go doc of this package,
you will get same message.
We do go doc of fmt,
you get much more than that.
You will get actually the full documentation,
which is pretty big, with
all the different functions that appear in fmt.
What if I care about a specific function?
Well, I can do go doc fmt Printf,
and that will give me the documentation
for that specific function.
Another option is to run go
doc binary with -http and give it a port.
Now, when you're running this,
what you're doing is actually listening on port 6060.
So, when I visit it,
you can see that the packages.
We can see all the packages in my machine.
Not only the packages in
the standard library, that is cool,
but all the packages that I've ever downloaded.
So, for instance, we can find Gorilla and
Gorilla mux, which is something that I regularly use.
Which means that I have access to all of
this documentation even when I'm
traveling around and I'm
an airplane without connectivity.
>> So, that was Go Tooling in Action
which is the video that started everything.
Actually, not only became a video but
also a workshop. You can find the link
to the video but also
the link to the workshop with all the material
that you can do online by yourself, down here.
>> Where can our viewers go to get started.
So, somebody interested in learning Go, where do we go?
>> Now, JustForFunc is a place where you could go.
But golang.org is the homepage of Go.
So, that's where you're going to find all of the things.
There's a tour, which is super useful,
I recommend trying it,
you don't necessarily need to
do the whole thing the first day.
Don't worry about that but definitely have a try at that.
There's also a bunch of online resources,
the best place to find them probably is going to be on
the Gophers Slack, so gophers.slack.com.
There's a lot of people in there,
most of them are nice.
There's a #newbies channel,
you can go there and ask questions.
No one will judge you if you
have questions that are really basic,
that's the whole objective of the channel anyway.
So, yeah and also Twitter on golang.org.
So, @golang is a nice place
to see whether there's new releases,
new talks, and things like this.
>> We have the links below in
the show notes, so check those out.
Make sure to go to opensource.microsoft.com,
to learn more about all the cool stuff we're working on.
Tap that subscribe button to stay tuned for
the next episode. My name is Brandon Minnick.
>> I'm Francesc Campoy.
>> Thanks for watching.
Không có nhận xét nào:
Đăng nhận xét