Learn to Code Go in 17 minutes | Golang Programming Crash Course

Sdílet
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

Komentáře • 102

  • @DThompsonDev
    @DThompsonDev Před 3 lety +31

    This is awesome Anastasia! As a Go developer you covered quite a bit. Really good resource for someone being introduced to go!

  • @aelxkethdam8491
    @aelxkethdam8491 Před 3 lety +5

    Wow now i know go, love how fast you go through everything. Skipping the Hello World routine was genius.

  • @ScriptureFirst
    @ScriptureFirst Před 3 lety +3

    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 🙏🏼

  • @bopon4090
    @bopon4090 Před 2 lety

    The most informative description box I have ever seen. thank you for the video.

  • @joonasfi
    @joonasfi Před 3 lety +2

    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!

  • @TheStefanGenov
    @TheStefanGenov Před 3 lety +5

    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

  • @barindersingh5810
    @barindersingh5810 Před 3 lety +13

    Appreciate The Recent effort and Content that u put through ur video..simple and straight forward no time-wasting 💓. You've been killin' it 👍👍🙏🙏

  • @matobago
    @matobago Před 3 lety +1

    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

  • @satyapraneethkatta1652

    Beautiful Video !! Reignited and inspired me to learn Go. Surely one of the best crash courses on Go.

  • @developerhabits
    @developerhabits Před 3 lety

    Great intro video. I haven't written Go before, but you made it easy to follow and understand.

  • @melkaouianas5633
    @melkaouianas5633 Před 3 lety +1

    Thanks for the quick overview ! a simple web app with Go would be cool !

  • @shivanshusiyanwal296
    @shivanshusiyanwal296 Před 3 lety +2

    2 videos in a week! Nice!

  • @stevenazar9940
    @stevenazar9940 Před 2 lety

    Expecting the usual explainer's pace I initially cranked up the playback speed, BIG MISTAKE! Packed with well-explained, useful info, great video!

  • @sangeethshaju91
    @sangeethshaju91 Před 3 lety +1

    Just 17 mins is all she needs. Muchas gracias. ♠️

  • @sampathbalivada-personal

    Thank you. This helped me refresh my go knowledge before starting my project.

  • @thinksiamallamacom
    @thinksiamallamacom Před 2 lety

    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!

  • @Playstation1
    @Playstation1 Před 3 lety +2

    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 :)

  • @prantikdeb3937
    @prantikdeb3937 Před 3 lety

    Wow!! Back to back videos 🔥👏

  • @aabidsofi19
    @aabidsofi19 Před 2 lety

    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 ....

  • @SUGATORAY
    @SUGATORAY Před 3 lety

    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. :)

  • @russelfernandes8483
    @russelfernandes8483 Před rokem

    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.

  • @kombi1697
    @kombi1697 Před 2 lety

    Being bumping into go of late, nice tutorial to get one started.

  • @kent_hdd
    @kent_hdd Před 3 lety +2

    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.

  • @rineeshparai1780
    @rineeshparai1780 Před 3 lety

    Excellent introduction to a new language. We need this for all major languages.

    • @mona.supremacy
      @mona.supremacy Před 3 lety

      @@Anastasia-Marchenkova any particular reason to avoid JS?

  • @shieldddgempire296
    @shieldddgempire296 Před 3 lety

    Great Compilation!!

  • @shabirahmadazizi6385
    @shabirahmadazizi6385 Před 3 lety

    Excellent introduction

  • @nurjamil6381
    @nurjamil6381 Před 3 lety

    thank youuuu, i really need this

  • @sadclown1923
    @sadclown1923 Před rokem

    amazing, straight forward without wasting time.
    Go feels so good daddy.

  • @tyrick2481
    @tyrick2481 Před 3 lety +1

    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.

  • @gyanshree6203
    @gyanshree6203 Před rokem

    Very informative 😊

  • @drewbird87
    @drewbird87 Před rokem

    🤯wow. Thank you!

  • @kaneg6293
    @kaneg6293 Před 2 lety

    Nice tutorial thanks.

  • @Rakhu-e2f
    @Rakhu-e2f Před 3 lety

    You video is so knowledgeable
    Your teaching style is excellent Ma'am
    Ma'am plz upload more videos on programming.

  • @JK-bx1ut
    @JK-bx1ut Před 2 lety +3

    Finally a person who delivers only relevant information and in the right pace! This is so great - thank you! спасибо большое :-)

  • @cambridgebreaths3581
    @cambridgebreaths3581 Před 3 lety +4

    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

  • @MuriM
    @MuriM Před 3 lety +6

    Let's Go!

  • @staa7731
    @staa7731 Před 3 lety +1

    `We have an exponential crisis`
    Haha that got me soo good XD

  • @georgiodc
    @georgiodc Před 3 lety

    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

  • @darkenviado3446
    @darkenviado3446 Před 3 lety

    Thank you ❤️

  • @baxiry.
    @baxiry. Před 3 lety

    very fast & very clear

  • @richardikin
    @richardikin Před 3 lety

    I sense a GO project in my future.

  • @sina-qh8wm
    @sina-qh8wm Před 3 lety +1

    short video but effective, every one should like & subscribe :)

  • @alexd42dani
    @alexd42dani Před 3 lety +1

    wow this is really a crash course

  • @alihouadef5539
    @alihouadef5539 Před 3 lety +3

    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?

    • @mintakan003
      @mintakan003 Před 3 lety

      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.

    • @goncaloteixeira5800
      @goncaloteixeira5800 Před 3 lety +1

      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

    • @mintakan003
      @mintakan003 Před 3 lety +1

      @@goncaloteixeira5800 It was also highly recommended at the Lawrence Berkeley National Laboratory supercomputer center (NERSC). Great tool for high level, performant, scientific computing.

  • @cedric1731
    @cedric1731 Před 3 lety

    Wanted to dig into C++ next. Order of plans might have changed now... ^^

  • @TechiiEngineer
    @TechiiEngineer Před 3 lety +3

    after watching this video can I add GOLANG in my resume?

  • @andressalazargaleano6419
    @andressalazargaleano6419 Před 3 lety +1

    love go

  • @todaysmotivation9692
    @todaysmotivation9692 Před 2 lety

    Brain with beauty ♥️

  • @NoNameNoShame22
    @NoNameNoShame22 Před 3 lety +4

    Me be like Neo in The Matrix: I know Go now.

  • @bernardonavarrete6656
    @bernardonavarrete6656 Před 3 lety

    Gracias!!!

  • @gv6758
    @gv6758 Před 3 lety

    Hey, what computer do you use?

  • @doesexistthisname
    @doesexistthisname Před 2 lety

    Yes, in 17 minutes, but speaking at 2x... 😁
    Very useful, thanks!

  • @goncaloteixeira5800
    @goncaloteixeira5800 Před 3 lety

    Awesome video.
    What do you usually use Golang for? CLI's?

    • @g_c6668
      @g_c6668 Před 3 lety +1

      Web stuff, especially back end, if I understand correctly..

  • @raquibhasib1710
    @raquibhasib1710 Před 3 lety

    Hello Anastasia
    Nice video....

  • @iqlaasismail2288
    @iqlaasismail2288 Před 3 lety

    is this repo available on github or somewhere?

  • @Reliquancy
    @Reliquancy Před 3 lety

    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.

    • @Reliquancy
      @Reliquancy Před 3 lety

      @@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.

  • @oslogrigor8320
    @oslogrigor8320 Před 3 lety +1

    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? 😅

  • @MohammedAbbasPLUS
    @MohammedAbbasPLUS Před 3 lety +2

    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.

  • @eleonorlopez9612
    @eleonorlopez9612 Před 3 lety

    Hi.do you have any golang talent/company you can refer?

    • @eleonorlopez9612
      @eleonorlopez9612 Před 3 lety

      Not to directly hire them but to assign to them these golang projects that we have

  • @BenjaminWheeler0510
    @BenjaminWheeler0510 Před 3 měsíci

    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

  • @AL6S00740
    @AL6S00740 Před 3 lety

    Damn cool

  • @spinning-around
    @spinning-around Před 3 lety

    How it helps with physics?

  • @WilliamDye-willdye
    @WilliamDye-willdye Před 3 lety

    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.

  • @jagaryousef9648
    @jagaryousef9648 Před 2 měsíci

    Cool one, but the last 2 sections examples can be simpler ones

  • @ralexis12
    @ralexis12 Před 3 lety

    💪🏽💯💯🔥🔥

  • @davida.7586
    @davida.7586 Před 2 lety +1

    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 ?

  • @destroyer2973
    @destroyer2973 Před rokem

    Why not emacs.

  • @CurlyCow
    @CurlyCow Před 7 měsíci

    "Annoying, but livable." hey, just like me!

    • @Anastasia-Marchenkova
      @Anastasia-Marchenkova  Před 7 měsíci +1

      Bahahhhaha.
      I need to go back and watch what I said that about!!

    • @CurlyCow
      @CurlyCow Před 7 měsíci

      @@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.

  • @timebroua
    @timebroua Před rokem

    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

    • @till8413
      @till8413 Před rokem

      @@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

  • @antonpil135
    @antonpil135 Před 3 lety

    Есть видео, как на русском говорит?

  • @pranavtupe8290
    @pranavtupe8290 Před 3 lety

    I love Go more than Python

    • @user-vm1wr7ib1n
      @user-vm1wr7ib1n Před 2 lety

      @@Anastasia-Marchenkova so cute

    • @curious_one1156
      @curious_one1156 Před 2 lety

      @@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.

  • @dxb7744
    @dxb7744 Před 3 lety

    Уфф сложно понять 😣😖

  • @KayakingThroughLife
    @KayakingThroughLife Před 10 měsíci +1

    How can you kill a cactus? You have to be really bad! :p

  • @sunquake
    @sunquake Před 2 lety

    Можно по-русски, Настя??

  • @donaldduck5731
    @donaldduck5731 Před 3 lety

    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

  • @belfegorcit4324
    @belfegorcit4324 Před 3 lety

    Вы за бугром учились сразу или православный физтех, физфак оканчивали? =)

  • @adrien-barret
    @adrien-barret Před 3 lety

    cool but too fast when you speak

  • @miguelonex53
    @miguelonex53 Před 3 lety +2

    You're gorgeous 💖💖💖

  • @user-fj7wb6ji7w
    @user-fj7wb6ji7w Před 3 lety

    С кактусом всё понятно, а вот почему собачка морковку ест - ?! ))

    • @user-fj7wb6ji7w
      @user-fj7wb6ji7w Před 3 lety

      @@Anastasia-Marchenkova Может иногда в морковку мясо незаметно добавлять? Вдруг тогда собака мясо полюбит?)

    • @curious_one1156
      @curious_one1156 Před 2 lety

      Dogs and carrots ??!

    • @curious_one1156
      @curious_one1156 Před 2 lety

      Oh, I skipped maps.

  • @brogrammer8783
    @brogrammer8783 Před 2 lety +1

    A beautiful blond that knows tech. It's too overpowered. It's not fair

  • @snouk9017
    @snouk9017 Před 3 lety +1

    I heard the sweet melody of the mermaid singing... But my heart already belongs to Rust. Sorry honey :

  • @unknownuser5260
    @unknownuser5260 Před 3 lety +1

    I would love to learn you honey........😘