Hey Thomas! Really enjoyed this video. Love that intro, all the different images and the music/sound effects throughout. It was really clear, easy to follow and understand and well explained. I haven't learned GO yet, but seems like a cool language! I know making these videos is not an easy task so keep up the awesome work!
As a c# developer, I found it strange that Go did not use generics and enums. My friends and the internet were like "it does not need it". The look on the faces now... I love it.
Yeah I totally get that. As a former Java developer, it felt totally strange that go does not have concepts like inheritance or generics. But now with generics...the world is becoming a better place :D Thanks for the comment, btw! Really appreciated.
Hi. It makes me happy to hear that you like the language. To be honest, my experience with C is practically non existent. But I heard from people who used it a lot, that they also liked it a lot aswell.
This is one of the reasons that I want to learn Go: its C-like elegance and beauty. At the same time, when you have garbage collector, you can debate if it give or take some elegance from the language. I'm still split on this question.
@@2002budokan Rust is already in my top 3 languages to I want to learn. But it has very different wibe that C. C is about giving you right tool, but nothing more (and their choice of "right tools" is not always right). Rust look to me as features extravaganza.
@@kamilziemian995 Rust compiler don't let you make memory-leak mistakes. Very clever compiler. It does take some time getting used to, but not too long. Compare it with C++ not with C. Don't waste time start with Rust. I did it and didn't regret.
I can totally understand your opinion. I think it depends on your programming style as well as the applications you write. For me, who often needs to convert from string to bools, floats, ints or timestamps, generics are a blessing. I can get rid of so much code now and replace it with generic functions. But I can totally understand since in many cases func f(v interface{}) is enough. Thanks for the comment and your opinion!
I’m a hardcore ‘Modern C++’ developer but have been doing some Go programming recently on a pet project in my spare time, The absence of generics is driving me nuts, so I’m very much looking forward to getting my hands on this. Now if only they would give us exceptions…
Welcome to the gophers club! Yeah, i have to say that missing generics, missing exceptions and no real enums are a things that drove me crazy when I was learning go. As for exceptions, you can try to use panic and recover. I hate it to be honest:D It just feels super dirty. But you can try it out. Maybe it works for you. Let me know if you did and how your experience with it was please. Maybe I did something wrong ;)
Thanks for the comment! To be honest...I do not miss enums at all, since I can define my own types. Just like I did with weekdays. Is there something I am missing?
I guess the difference is that Enums are a closed set of values. That means a switch statement can warn you if you haven’t covered all the cases not specified a default case. Some people consider this useful because when a new requirement turns into a new value in the enum, the compiler will flag all the switch statements that need to be updated. I’ve seen “hacks” to get this behavior and they look ok to safeguard critical sections.
am I weird that I think its better without generics? like we are using a statically typed language so we can know for sure what's happening. making it more generic makes things more vague and opens up possible unplanned uses for our functions.
Yes, you are weired 🤣 Just kidding. I can understand your point. I guess it comes down to personal preference. I have been waiting for generics for a whole while and am glad that they are in this language. Coming from Java, I am used to generic and OOP programming. That's why I missed them when I switched to Go.
yes, you are right! The battle is still going on. Usually I favor the "simple, even if it is ugly" team. But in case of generics, I am all in "pretty, even if it is complex". It's probably due to my java background. What is your opinion on that topic? Thanks for the comment btw! Much appreciated!
@@baxiry. That is the biggest benefit of Generics IMO. Even the "pure" Golang standard library has places where you could see Generics would have made this more intuitive and easy to use
That is actually quite interesting. What languages are you speaking of? To be honest, I haven't heard of the term "type classes". Or I am completely spacing out right now :D I know that in Java, C++, Python and TypeScript it is called generics. These are the OOP languages I used so far. Thanks for the comment btw!
@@ThomasLanghorst I meant in Scala and Haskell(probably typescript also already has something similar). Specifically the exact same mechanism of "constraints" presented in this video is very similar to Scala's "context bound"
Rob "Commander" Pike said that more proper name for "Go's generic" is "parametric polymorphism". Do you still want to complain about "scientific gibberish"? 😁
Ok, now let's do this: func Zip[K comparable, V any](keys []K) func(values []V) map[K]V { // code here... } It should turn one slice into keys, and the second one into values of a resulting map, like this: Zip(someKeys)(someValues) Implement it and try to invoke it. Then tell me if the generics in Go are so awesome.