Level Up Your Golang: 5 Concepts You Need to know

  Рет қаралды 8,474

Flo Woelki

Flo Woelki

Күн бұрын

Пікірлер: 35
@CrayonEater9845
@CrayonEater9845 2 ай бұрын
I've been writing Go for a month, but have 5 years in industry. These are all pretty basic concepts in Go. Also don't use goto. It destroys control flow and there are other ways to do what it enables. If you look at C, goto exists, but you really only see its use when taking emergency recovery actions like in the Linux kernel.
@FloWoelki
@FloWoelki 2 ай бұрын
I agree with you, but it's definitely good to know the concepts. Sure, they do destroy in some way the control flow, but when used correctly, they can simplify things a lot and make your code even more readable and maintainable. Even the official standard library uses `goto`.
@DavidSmith-ef4eh
@DavidSmith-ef4eh 8 күн бұрын
c# implementation of LINQ and some of their other features use goto. I assume there is a usecase for everything, its' just discouraged since people would abuse it.
@grouponsurgeon
@grouponsurgeon 21 күн бұрын
You might not have set out to explain bit shifting but you did a pretty good job of simplifying the concept
@FloWoelki
@FloWoelki 20 күн бұрын
Thank you :) I might make a video about bit shifting in the future.
@adanpalma4026
@adanpalma4026 7 күн бұрын
For me go to is label break just for bring some clarity. Because goto outherloop is better that just break
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 22 күн бұрын
simple and to the point, thank you :)
@FloWoelki
@FloWoelki 22 күн бұрын
Glad it helped! :)
@matthew1106
@matthew1106 2 ай бұрын
More videos like this please!
@FloWoelki
@FloWoelki 2 ай бұрын
Sure, I'll try my best!
@cariyaputta
@cariyaputta 2 ай бұрын
Nice golang focused videos, added to my library.
@FloWoelki
@FloWoelki Ай бұрын
That's awesome, thank you :)
@sehbazrafik
@sehbazrafik 2 ай бұрын
amazing video, can you please have your dev setup on the laptop + desk tour video.
@KanishkaDilshan
@KanishkaDilshan 25 күн бұрын
Great content!
@FloWoelki
@FloWoelki 23 күн бұрын
Thank you so much! :)
@esra_erimez
@esra_erimez 19 күн бұрын
"Go To Statement Considered Harmful" -Edsger Dijkstra
@adanpalma4026
@adanpalma4026 7 күн бұрын
😂 please. That was said in a context totallundiferent where go to was used indicriminated as in basic where you can jump to anywhwere in the code. This is no the case
@thewalkthroughmaking
@thewalkthroughmaking 6 күн бұрын
From now on I'm going to start quoting "This is somehow a problem, cuz it's not really beautiful and it is really really ugly" daily hahahaha
@FloWoelki
@FloWoelki 3 күн бұрын
That's the spirit :D
@MattRobinsonDev
@MattRobinsonDev 2 ай бұрын
great stuff
@FloWoelki
@FloWoelki 2 ай бұрын
Thank you :)
@李伟鸣
@李伟鸣 29 күн бұрын
good stuff!
@FloWoelki
@FloWoelki 29 күн бұрын
Thank you :)
@lemurza5236
@lemurza5236 2 ай бұрын
Generally speaking you should avoid labels. They are one of the features of Go that hurt the language in a big way. Labels and Goto are horrible and should be avoided at all costs
@FloWoelki
@FloWoelki 2 ай бұрын
I agree, generally speaking you should avoid these, especially for simple flows. However, they do exist for a reason, and even the standard library of Golang uses both concepts. Obviously, they should be used judiciously. But, especially for things like simplifying error handling and cleanup code (in some cases) can lead to more readable and maintainable code.
@adanpalma4026
@adanpalma4026 7 күн бұрын
@@FloWoelkiyes that is the point. Its like a go sub or call func in long infinite chain call. Like call func1 and in func1 call func 2 and son on. In this case we are dividing and specialiating code but in a bad way of control. Is the same with labels in go. If you use in a propper way no problem. People are afraid of goto because of basic where you can go to anywhere in the code but labels in go are fantastic tool
@justinjustin4605
@justinjustin4605 Ай бұрын
what theme is that?
@FloWoelki
@FloWoelki Ай бұрын
It's the GitHub theme :)
@richardbolanos50
@richardbolanos50 2 ай бұрын
When it comes to the new keyword what is the difference between return new(Counter) and return &Counter{} if any. Is there a performance benefit by any chance
@loo_9
@loo_9 2 ай бұрын
there should not be a performance difference, but the only way to truly know this is benchmarking. the compiler would recognize that the memory escapes the function scope so it has to be heap allocated. the only difference is that {} you can specify initial values
@FloWoelki
@FloWoelki 2 ай бұрын
I agree; there shouldn't be any performance difference because the Go compiler optimizes both expressions similarly. I think this is a valuable discussion: groups.google.com/g/golang-nuts/c/GDXFDJgKKSs
@richardbolanos50
@richardbolanos50 2 ай бұрын
@loo_9 and @FloWoelki thanks for taking the time to reply.
@ArthurSchoppenweghauer
@ArthurSchoppenweghauer Ай бұрын
iota is a greek word and is pronouced iota.
Creating custom struct tags in Golang is awesome!
24:42
Flo Woelki
Рет қаралды 6 М.
You are providing fallback values in Golang wrong!
13:10
Flo Woelki
Рет қаралды 2,4 М.
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,2 МЛН
Фейковый воришка 😂
00:51
КАРЕНА МАКАРЕНА
Рет қаралды 7 МЛН
Linus On LLMs For Coding
17:06
ThePrimeTime
Рет қаралды 255 М.
Why I Don't Like Singletons
29:05
The Cherno
Рет қаралды 61 М.
Why HTMX and Golang? The answer might surprise you...
12:04
Flo Woelki
Рет қаралды 10 М.
This is your last video about Golang Structs!
15:57
Flo Woelki
Рет қаралды 4,9 М.
Golang: The Last Interface Explanation You'll Ever Need
17:58
Flo Woelki
Рет қаралды 12 М.
Why I’m Switching To Go in 2024
8:10
Awesome
Рет қаралды 57 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 178 М.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Рет қаралды 108 М.
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,2 МЛН