What are the iterators used for? Obviously I can iterate trough a slice without them. I can double (or transform in some other way) the value without them. Can I use them to iterate through a struct? If not, I am absolutely clueless why this exists. Perhaps an example that accomplishes something useful, not easily done before, would help understand.
Do you think people will start creating their own iterators for utilities (like iterate over a slice in reversed order) or we’ll see more packages like in JS, where there are many packages that give built in functionalities
Honestly, I do think that some people will create their own iterators for their libraries because they give you a lot of flexibility and developer-friendliness. Clearly, I cannot predict the future, so let's see where it goes :D
Yeah, the syntax is just mental :D Something like custom iterators in Rust is way more beautiful than in Go. But yeah, there were also a lot of discussions in the community; let's see where it goes.
The syntax is the way it is because of performance issues when using interfaces. This syntax allows you to use the functionality completely in the stack without needing to access the heap
@@flarebear5346 Also, I think it might be against the idiomatic practices of Golang. So, Go emphasizes simplicity and directness, avoiding more complex design patterns. But all in all, you will probably most likely won't use iterators that much :D
@epsigo never really changed, again if you don’t like a feature, just don’t use it. The day when Golang will become craps, it’s will be the day of the 2.0 update where old codes will just broke. Until them, there are nothing to worry.
Thank you! I've found a lot of examples out there, but I was able to understand how that works just now
That's so awesome to hear :) Glad it helped!
Its confusing af. All the callback and syntactic sugar kind of hard to understand
Congratulations on 10K subs sir. I'm happy I was here before this milestone 😊
Thank you very much! I appreciate that you are part of this journey!
Function inside function inside another function...
Little confused, hope will get it know.
thank God I'm not the only one confused
What are the iterators used for? Obviously I can iterate trough a slice without them. I can double (or transform in some other way) the value without them. Can I use them to iterate through a struct? If not, I am absolutely clueless why this exists. Perhaps an example that accomplishes something useful, not easily done before, would help understand.
pray tell how you are making these videos they are awesome !
Do you think people will start creating their own iterators for utilities (like iterate over a slice in reversed order) or we’ll see more packages like in JS, where there are many packages that give built in functionalities
Honestly, I do think that some people will create their own iterators for their libraries because they give you a lot of flexibility and developer-friendliness. Clearly, I cannot predict the future, so let's see where it goes :D
Thank you for your video! It would be very helpful if you could also share your code by providing a link in the video description.
what code editor do you use atm and in this vid?
I use the Zed Editor :)
Are you interested in creating a Udemy course? to teach the go language, because you explained it very well with an interactive video
the sintaxis is ugly , i prefered it if it was a interface with a HasNext and Next methods or something like that
Yeah, the syntax is just mental :D Something like custom iterators in Rust is way more beautiful than in Go. But yeah, there were also a lot of discussions in the community; let's see where it goes.
The syntax is the way it is because of performance issues when using interfaces. This syntax allows you to use the functionality completely in the stack without needing to access the heap
@@flarebear5346 Also, I think it might be against the idiomatic practices of Golang. So, Go emphasizes simplicity and directness, avoiding more complex design patterns. But all in all, you will probably most likely won't use iterators that much :D
Not sure where I read that Golang is a fool proof language, easy to learn for any noob.
@epsigo never really changed, again if you don’t like a feature, just don’t use it.
The day when Golang will become craps, it’s will be the day of the 2.0 update where old codes will just broke.
Until them, there are nothing to worry.
@@gungun974 yeah, just dont use it. Unless ur boss tells to fix a bug in their custom iterator function. Then good luck not using it, lol.
It's like a dog scratching his right ear with his left leg. Terrible syntactic choices, in my opinion.
Again, fix the Go Gopher art or this entire playlist is copyright infringement
Thank you for the information. Would a short notice in the TH-cam description be enough, or what do you recommend?