BRUH. The universe might actually be alive. I have been struggling to understand templates and was a bit sad that you didn't drop a video on them. Now here you are. FTW.
Template meta programming with (partial) specialization is such a wildly different language than to "regular" C++. And it's such an incredibly deep rabbit hole. Interestingly enough, my knowledge about this topic really helped to understand Haskell a lot better during the semester it has been taught in. The signature pattern matching in partial specializations is almost identical to how Haskell functions are overloaded for their use cases. C++ really helps to become a better programmer, because it exposes the user to a lot more concepts than certain other languages that deem certain mechanisms to low-level or dangerous to be exposed to the programmer. But seeing how C++ was helpful for such an unrelated language with very different paradigms was just wild. :D
Thanks for sharing! Did not think of this parallel! I have only played a little with functional language but yes, the recursiveness of template meta programming I guess is what makes the experiences similar.
I came back to c++ after spending some time with ocaml, rust, and idris, and everything was so much easier. This template stuff makes a lot more sense now and these videos are really good
Great video! One thing that bothered me a bit was usage of " to specify template parameter. The parameter has nothing to do with class, it could be just as easily called , the word "class" gives a wrong impression, at least to me. Thanks!
Ok, I agree with you that ClassT doesn’t hit the mark. What I prefer doing generally (when I cannot use concepts) is to give the template parameters meaningful names. Considering that this function is very illustrative and doesn’t really have a proper purpose it is hard to pick such a template parameter name, meaning the one that actually makes sense. So here I picked the ClassT as a substitute but I agree that it is a bit stupid and if I would have thought longer about it I probably would have just used T here. Thanks for your comment!
BRUH. The universe might actually be alive. I have been struggling to understand templates and was a bit sad that you didn't drop a video on them. Now here you are. FTW.
Hope it helps 😅
Template meta programming with (partial) specialization is such a wildly different language than to "regular" C++. And it's such an incredibly deep rabbit hole.
Interestingly enough, my knowledge about this topic really helped to understand Haskell a lot better during the semester it has been taught in. The signature pattern matching in partial specializations is almost identical to how Haskell functions are overloaded for their use cases.
C++ really helps to become a better programmer, because it exposes the user to a lot more concepts than certain other languages that deem certain mechanisms to low-level or dangerous to be exposed to the programmer. But seeing how C++ was helpful for such an unrelated language with very different paradigms was just wild. :D
Thanks for sharing! Did not think of this parallel!
I have only played a little with functional language but yes, the recursiveness of template meta programming I guess is what makes the experiences similar.
I came back to c++ after spending some time with ocaml, rust, and idris, and everything was so much easier. This template stuff makes a lot more sense now and these videos are really good
@harleyspeedthrust4013 thank you so much! Hope you keep enjoying the videos coming next! 🙌
Great video! One thing that bothered me a bit was usage of " to specify template parameter. The parameter has nothing to do with class, it could be just as easily called , the word "class" gives a wrong impression, at least to me. Thanks!
Ok, I agree with you that ClassT doesn’t hit the mark. What I prefer doing generally (when I cannot use concepts) is to give the template parameters meaningful names. Considering that this function is very illustrative and doesn’t really have a proper purpose it is hard to pick such a template parameter name, meaning the one that actually makes sense. So here I picked the ClassT as a substitute but I agree that it is a bit stupid and if I would have thought longer about it I probably would have just used T here. Thanks for your comment!
For the win, my man
Nice T-short, man!
Thanks, Dima 😉