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.
@FloWoelki2 ай бұрын
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-ef4eh8 күн бұрын
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.
@grouponsurgeon21 күн бұрын
You might not have set out to explain bit shifting but you did a pretty good job of simplifying the concept
@FloWoelki20 күн бұрын
Thank you :) I might make a video about bit shifting in the future.
@adanpalma40267 күн бұрын
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_chars22 күн бұрын
simple and to the point, thank you :)
@FloWoelki22 күн бұрын
Glad it helped! :)
@matthew11062 ай бұрын
More videos like this please!
@FloWoelki2 ай бұрын
Sure, I'll try my best!
@cariyaputta2 ай бұрын
Nice golang focused videos, added to my library.
@FloWoelkiАй бұрын
That's awesome, thank you :)
@sehbazrafik2 ай бұрын
amazing video, can you please have your dev setup on the laptop + desk tour video.
@KanishkaDilshan25 күн бұрын
Great content!
@FloWoelki23 күн бұрын
Thank you so much! :)
@esra_erimez19 күн бұрын
"Go To Statement Considered Harmful" -Edsger Dijkstra
@adanpalma40267 күн бұрын
😂 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
@thewalkthroughmaking6 күн бұрын
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
@FloWoelki3 күн бұрын
That's the spirit :D
@MattRobinsonDev2 ай бұрын
great stuff
@FloWoelki2 ай бұрын
Thank you :)
@李伟鸣29 күн бұрын
good stuff!
@FloWoelki29 күн бұрын
Thank you :)
@lemurza52362 ай бұрын
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
@FloWoelki2 ай бұрын
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.
@adanpalma40267 күн бұрын
@@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Ай бұрын
what theme is that?
@FloWoelkiАй бұрын
It's the GitHub theme :)
@richardbolanos502 ай бұрын
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_92 ай бұрын
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
@FloWoelki2 ай бұрын
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
@richardbolanos502 ай бұрын
@loo_9 and @FloWoelki thanks for taking the time to reply.