Learn to Code Go in 17 minutes | Golang Programming Crash Course
Vložit
- čas přidán 27. 07. 2024
- Welcome to this Crash Course in Go! Now if you’re here you’ve probably heard some good things about Go - low number of keywords in the language, which allows it to be picked up easily and intuitively like an interpreted language like python, while still being fast like C++. And all those cool concurrency features makes it a very good language for efficient software!
This video, of course in no way comprehensive of EVERY feature of Go, but enough to get you started!
Join this channel to get access to perks like behind the scenes and support my channel!
/ @anastasia-marchenkova
or the same perks over on Patreon:
/ amarchenkova
Chapters:
0:00 Why Go?
0:34 Install Go & Jetbrains Goland
1:05 Packages, imports, main, and print
2:29 Basic Types & Operators
4:19 Composite Types: Arrays and Slices
7:02 Maps
8:07 Structs
8:58 Control Flow: If
9:26 Switch
9:58 For loops
10:44 Functions
11:25 Methods
11:49 Interfaces
13:27 Empty Interfaces
14:16 Goroutines & Channels
Resources to learn more Go!
Tour of Go: tour.golang.org/
The Go Programming Language Book: amzn.to/313UvqP
Go By Example: gobyexample.com/
Udemy course Learn How to Code: Google's Go (Golang) Programming Language: click.linksynergy.com/link?id...
Building Web Applications with Golang: astaxie.gitbooks.io/build-web...
Now, by the way, today I'm using the Jetbrains Go IDE Goland which you can get at www.jetbrains.com/go/.This is what I use in my professional development environment, but it does cost money. However there's a free trial for 30 days and after that you can continue using it, it will just have to restart every 30 minutes. That's annoying, but liveable.
Go programs are organized into packages. A package is a collection of source files in the same directory that are compiled together.
You can use gofmt or goimports tool to sort imports, and in Goland you can set up a file watcher in preferences with gofmt and go imports.
Go's basic types:
Bool
String
Int and uint - signed and unsigned integers
float
And variations with different bit sizes
You can have int8, 16, 32, and 64, and unsigned ints uint8, 16, 32, and 64
Unsigned ints are only positive values, while signed ints range from negative to positive
Int32 is also called a “rune”
And a byte is the same as uint8
You can apply basic mathematical operators and comparisons to numeric types, so add numbers together, multiply, compare greater than, less than, and bitwise binary operators.
Strings can also be concatenated with a plus sign.
We can then combine these basic types into composite types!
Arrays is a sequence of elements of one type, and it’s a fixed length.
Slices are similar to arrays, but they can vary in length. You write it the same way as an array, but do not specify the number of elements.
Slices are really just pointers to an underlying array with a length and capacity, but they can grow in that length and capacity. The length is how many elements the slice has, the capacity is how much memory or space is available for elements. So a slice with a length of 3 has 3 elements in it, but may have a capacity that’s larger so you can add elements to it without having to expand the memory. This actually leads to interesting performance implications.
The crucial thing we can do with a slice is APPEND.
Like most languages, Golang has an if statement, switches, and for loops. However, Go does not have while loops!
A method is a function, but it also has a receiver argument, so which type it’s attached to.
We can also have an empty interface.
If we don’t know what types we’re going to get back, the empty interface can have any value assigned to it. You can think of an interface of holding the value, and the type.
Goroutines are similar to threads, but much cheaper, that can spin off and do their own thing.
Channels communicate between goroutines. Why do goroutines need to communicate? Well, we need to know when goroutines are done, and when we need to wait or continue.
Go routines and channels is where programming really gets interesting. A lot of programming is very sequential, and goroutines and channels can spin off operations while other code runs. It’s SUPER powerful!
Disclaimer: Affiliate links may be used in my recommendations! If you buy through my links I provide, I may receive a portion of the sale amount. This doesn't change the price you pay.
#golang #programming #learntocode - Věda a technologie
This is awesome Anastasia! As a Go developer you covered quite a bit. Really good resource for someone being introduced to go!
Wow now i know go, love how fast you go through everything. Skipping the Hello World routine was genius.
14:20 every CZcams explainer needs to watch this sequence. She took the time to concisify nearly a minute of continuous instruction. No filler words: just good use of my time. God Bless you 🙏🏼
The most informative description box I have ever seen. thank you for the video.
As an experienced Go programmer myself, I must say you did a good job! You even warned about the random iteration order with maps, that was a nice touch I was expecting if this was high quality content, and you delivered!
Damn! I never realized how bad videos that explain everything at nausea are. This faster approach was definitely better. I was wondering about golang and didn't really wanna sit through an enormous tutorial and this was straight and on the point. Maybe not so good for people who are just getting into programming but I guess you wouldn't get into go at that point
Appreciate The Recent effort and Content that u put through ur video..simple and straight forward no time-wasting 💓. You've been killin' it 👍👍🙏🙏
Wonderful video, from data types to channels passing interfaces, structures and simple operators. You have the ability to simplify and condense a lot information, with easy to understand examples, excellent video thanks for sharing
Beautiful Video !! Reignited and inspired me to learn Go. Surely one of the best crash courses on Go.
Great intro video. I haven't written Go before, but you made it easy to follow and understand.
Thanks for the quick overview ! a simple web app with Go would be cool !
2 videos in a week! Nice!
Expecting the usual explainer's pace I initially cranked up the playback speed, BIG MISTAKE! Packed with well-explained, useful info, great video!
Just 17 mins is all she needs. Muchas gracias. ♠️
Thank you. This helped me refresh my go knowledge before starting my project.
This tutorial is amazing for someone like me who re-bounces to Go and want a refresh instead of rereading the docs. The pace is on spot, the speech is clear. Amazing job, well done! We need more women in tech please!
WOW! 😍 I absolutely LOVE your hair tied up into a Ponytail with a hair elastic in this video! :3 Should do it like that more often it looks the best ever xD Amazing Ponytail just subbed and excited for more videos to come :)
Wow!! Back to back videos 🔥👏
This is really nice video . Worked with go couple of months ago and yeah this some serious content for learning and revising .... thanks a lot ....
Fantastic!
Btw it was your Quantum Computation videos that rekindled my interest in QC. I had a course of QC over a decade ago. Very recently there was a QC competition (QHack) that I was able to rise up to a rank of 106 in two days! It was a constructive distraction alongside my PhD (Physics) work. And all that started with your videos and another post on LinkedIn.
So, kudos for the really cool and content-rich videos. :)
Excellent content and delivery Anastasia for anyone requiring a 30 minute recap (so one can stop a few times to think!) before delving back into Go programming.
Being bumping into go of late, nice tutorial to get one started.
Great video! I really needed a reminder of what an interface is.
I still have a couple of questions, if you are willing to answer:
1) Do you have a (professional) preference between C++ and Golang ?
2) Would an assembly language, such as x86, see much use when dealing with quantum computer programming ?
As a footnote, I would like to congratulate you for keeping a great balance between conciseness and technical details in the video. Made me download Golang and give it a try.
Excellent introduction to a new language. We need this for all major languages.
@@Anastasia-Marchenkova any particular reason to avoid JS?
Great Compilation!!
Excellent introduction
thank youuuu, i really need this
amazing, straight forward without wasting time.
Go feels so good daddy.
Great video!
Any plans that you will cover a simple topic on how to build a working project with databases?
I'm really interested in GO and I'd like to learn how can I make projects that I need to store/edit data.
Very informative 😊
🤯wow. Thank you!
Nice tutorial thanks.
You video is so knowledgeable
Your teaching style is excellent Ma'am
Ma'am plz upload more videos on programming.
Finally a person who delivers only relevant information and in the right pace! This is so great - thank you! спасибо большое :-)
Hi Anastasia. What is the main extra advantage ( other than being faster) if google does its search method by quantum computation?
Also if one choose between Go and python which one you recommend for absolute beginner. Thank you for your time
Let's Go!
@@Anastasia-Marchenkova да !
`We have an exponential crisis`
Haha that got me soo good XD
Such a well-paced video! Most of my experience is in Python. But, I picked up a new project that is in Go and you condensed a lot of the unique concepts in such a straightforward way. Thanks
Thank you ❤️
very fast & very clear
I sense a GO project in my future.
short video but effective, every one should like & subscribe :)
wow this is really a crash course
How good is GO for computational physics compared to other languages?
And is there large scale CAD applications that uses GO as a main programming language?
My impression is Golang is a good as a statically typed software engineering language. Good for back end applications (web, network, middleware, full stack, ...). It's kind of like an upgraded version of C. And not as complicated (and dangerous) as C++.
For math, data science, physics (?), I think I'd like something higher level, but simple and clean syntax, like Julia. And it has more performance, than Python, Matlab, R. And one can write performant loops with it.
I dont know how good it is for computational physics, but I'm learning it because I were told it was being used at CERN so it should be good
@@goncaloteixeira5800 It was also highly recommended at the Lawrence Berkeley National Laboratory supercomputer center (NERSC). Great tool for high level, performant, scientific computing.
Wanted to dig into C++ next. Order of plans might have changed now... ^^
after watching this video can I add GOLANG in my resume?
love go
Brain with beauty ♥️
Me be like Neo in The Matrix: I know Go now.
Gracias!!!
Hey, what computer do you use?
Yes, in 17 minutes, but speaking at 2x... 😁
Very useful, thanks!
Awesome video.
What do you usually use Golang for? CLI's?
Web stuff, especially back end, if I understand correctly..
Hello Anastasia
Nice video....
is this repo available on github or somewhere?
I’ve been doing like a “rough draft” in python because I can code almost as fast as I think and then translating it into go so it’s a thousand times faster.
@@Anastasia-Marchenkova Yeah, Go flies! It’s funny when I figure out something I wrote in python is going to have to run for a couple hours it’s faster to rewrite it in Go then run it than to wait for it to finish lol.
It's like trying to learn a language by starting with writing a novel. Not impossible, but god damn. Can I start with the alphabet or something? 😅
While watching your video wanted to write this comment so hope you see it.
I would like to support your channel however, our online banking system in Iraq are not acceptable internationally :( due to US sanctions. Would you accept direct bank transfer?
Regards.
@@Anastasia-Marchenkova
👍👍👍
Hi.do you have any golang talent/company you can refer?
Not to directly hire them but to assign to them these golang projects that we have
3:10 so what is sizeof int? I find it silly how every new language except rust has both int and int32. Why have both? It leads to more confusion, unless int is arbitrary length or something… same with rune and byte… we already know from C that it’s better to just use int8 to avoid confusion
Damn cool
How it helps with physics?
It holds my beer !
Nitpick at 3:02 : unsigned ints are only positive. And yes, I'm picking on minor stuff that isn't going to do any real damage. :-) At least the comment helps bump the YT algorithm.
Cool one, but the last 2 sections examples can be simpler ones
💪🏽💯💯🔥🔥
You explaining very good and fast, but of course, only for experienced senior developers, who want to get familiar with Golang in some minutes.
For people you just wanting to start, this is not possible. Why you're running ?
Why not emacs.
"Annoying, but livable." hey, just like me!
Bahahhhaha.
I need to go back and watch what I said that about!!
@@Anastasia-Marchenkova Ha! Yeah, it was funny when you said it. And thanks for this primer! I'm learning Go now and this was useful.
Even when video is pretty nice,
I had to decrease speed to 0.75 because it was way tooo quick.
If you're new to Go, the speed of video can blow your head away.
Feel tired
@@Anastasia-Marchenkova the speed was nice; normaly i have to set the speed to 1.5 or 2 while watching tutorials.
I didn't felt the need to set the speed up here!
thanks
Есть видео, как на русском говорит?
I love Go more than Python
@@Anastasia-Marchenkova so cute
@@Anastasia-Marchenkova I am already judging you.
Or not. I just remembered, I am not allowed to. You are the quantum physicist who teaches people how to code, possibly opening new career paths for them.
Уфф сложно понять 😣😖
How can you kill a cactus? You have to be really bad! :p
Можно по-русски, Настя??
Just what we need, another language. Basic, Pascal, Matlab, C, C++, and Python. are way too much for my little brain to retain. What’s easy in my book is to have just one or two languages, which can be learnt well which have full package support, work on ROS etc, C++ and Python ideally should be enough for anyone to learn in one lifetime. Finding ways to compile Python to run faster seems like the way to go, not more languages. Go, Julia etc
Вы за бугром учились сразу или православный физтех, физфак оканчивали? =)
cool but too fast when you speak
You're gorgeous 💖💖💖
С кактусом всё понятно, а вот почему собачка морковку ест - ?! ))
@@Anastasia-Marchenkova Может иногда в морковку мясо незаметно добавлять? Вдруг тогда собака мясо полюбит?)
Dogs and carrots ??!
Oh, I skipped maps.
A beautiful blond that knows tech. It's too overpowered. It's not fair
I heard the sweet melody of the mermaid singing... But my heart already belongs to Rust. Sorry honey :
I would love to learn you honey........😘