Good job Mike. I highly appreciate your crisp and point to point explanation. Keep it up 👍
@MikeShah Жыл бұрын
Thank you for the kind words!
@bluehornet67522 ай бұрын
Nice video, I especially like the reminder that the destructor is guaranteed to be called if an exception is thrown But I do have a question for you... Why are you returning an 8-byte integer reference from your operator[] overload(s), when you can simply return the (probably) 4-byte integer? Basically, I guess I'm wondering what the benefit is to returning reference to a primitive type in this case? Are you planning to allow method chaining or something? What would be the benefit(s) of doing it the way you did?
@MikeShah2 ай бұрын
In this particular instance you're right returning the value (4-byte integer) would be more optimal. For the strategy shown, returning the reference allows you to do: collection[idx] = some_value; // i.e. You can do the assignment by returning the reference.
@thestarinthesky_ Жыл бұрын
Great video! You're so awesome! references you're using and introducing in your channel for C++ says a lot how knowledgeable you're. Thanks for sharing with us.
@MikeShah Жыл бұрын
Cheers! Thank you as always for the kind words!
@TheRawi4 ай бұрын
Thank you man. You are very good at this 👍
@MikeShah4 ай бұрын
Cheers!
@Sergei_developer3 ай бұрын
Great lesson as always. I'm just curious if there are such excellent resources for mastering the Assembly language. Thank you, sir for this amazing content and your precious time. Indeed, you deserve tremendous respect and many more views.
@MikeShah3 ай бұрын
Cheers! There should be many great assembly lessons on KZbin -- at some point I'll update my own (kzbin.info/aero/PLvv0ScY6vfd9BSBznpARlKGziF1xrlU54) -- I tend to look at university courses, or otherwise compiler explorer to check assembly otherwise :)
@bernhardkneer5393 Жыл бұрын
Hi Mike, again a great video!! This new C++ makes it more and more hard to understand what is going on in the background. e.g. from 6:00 onwards with the overloading of the [ ] operator... how the hell does this statement myCollection[0] = 7; change the private data value? Is it because the [ ] operator returns a reverence to the memory of this index and then writing to it works? Is this some "dirty" implementation or is this normal in modern C++? ;-)
@MikeShah Жыл бұрын
Public interface can change the private underlying data -- the goal is to not change any private variables directly, but rather do it through the operator[]. This is true in programming languages. The reason for having both versions, is that one is for read access (i.e. const), and one is for writing a new value.
@_w62_ Жыл бұрын
Thanks for another great video. Could you recommend any C++ based graphic libraries that make uses of RAII so that I can have a feel of actual use case of it?
@MikeShah Жыл бұрын
Cheers! Try SFML
@dwolrdcojp2 жыл бұрын
Thanks Mike!
@MikeShah2 жыл бұрын
You are most welcome! 😁
@amitmulay7292 жыл бұрын
Thank you, I was waiting for this one. :)
@MikeShah2 жыл бұрын
Hehe you're most welcome Amit!
@dibyojyotibhattacherjee8972 жыл бұрын
Hey Mike,will there be any cmake series?
@MikeShah2 жыл бұрын
I have on my TODO list a series of ideas for a build systems series with 'shell scripts' 'make' 'cmake', and some other tools.
@dibyojyotibhattacherjee8972 жыл бұрын
@@MikeShah Thanks a lot for the heads up!
@Southpaw1012 жыл бұрын
@@MikeShah This will be really useful Mike. I have been waiting on something with cmake and Vcpkg. Would really appreciate it and Thanks again for all these classes.
@dhanushs18022 жыл бұрын
Wonderfully explained as always. Thank You.
@MikeShah2 жыл бұрын
Cheers!
@muhammedhasankayapnar9495 Жыл бұрын
Hi Mike, thank you for this series. I learnt a lot as a person who just has python programming background. For large scale data processing, is there any chance also to introduce us CUDA programming as well with C++ ?
@MikeShah Жыл бұрын
Cheers -- thank you for the kind words! I'll consider something like this in the future. I tend to lean towards OpenCL for compute as it is cross platform (though I've used both)
@windowsbuilderthegreat31212 жыл бұрын
Are exceptions in C++ expensive like in C#
@MikeShah2 жыл бұрын
Yes, relative to regular executing code. This blog has some performance numbers to show the relative scale (10x slower for code, or 100x slower for optimized code). pspdfkit.com/blog/2020/performance-overhead-of-exceptions-in-cpp/ I have not reproduced the experiment to confirm the numbers. For high performance systems (games, low latency trading, etc.) consider carefully if exceptions are the right tool for handling errors at run-time.
@thestarinthesky_2 жыл бұрын
Hi Mike. Thanks for this great tutorial. By any chance do you think this tutorial can help me to nail a c++ interview questions? or do I need to know more?
@MikeShah2 жыл бұрын
Cheers! I hope these videos certainly do help! Going through the series (including some of the 'interview portions') should help! As always, make sure to practice, and try building a few simple projects :)
@Lopito_PP2 жыл бұрын
Noob question, why is Collection[0] = 7 a memory leak? Is it because we are not doing the delete Collection in the end?
@MikeShah2 жыл бұрын
I'm assuming you mean around the 3 minute mark? Because we never deallocate 'Collection' which is part of the 10 integers allocated on the heap.
@odaialkhodary78722 жыл бұрын
are you using mac with m1 chip? how can i detect memory leakage on mac with m1 chip ? i can't download valgrin.
@MikeShah2 жыл бұрын
I do have a Mac M1, and the tool to use is called 'leaks'. Look out for a video later this week on how to use leaks!
@MikeShah2 жыл бұрын
url will be: kzbin.info/www/bejne/mJnLdYWjbpdpp6M (will be release by May 31, 2022)
@rinket7779 Жыл бұрын
Bro I like your vids but this video is extremely misleading. You spend a large portion saying that destructors are still called if an exception is thrown in the constructor. This is just not true. Try it. The example you then show to illustrate your point catches the exception in the constructor before it has a chance to escape. This is of course the case, as no exception then escapes the constructor at all. So from the pov of the cstor no exception occurred at all. Making the entire point a bit silly 😅 Other than that, good set of vids though!
@MikeShah Жыл бұрын
Cheers, can you give a timestamp?
@rinket7779 Жыл бұрын
@@MikeShaharound 10:25
@MikeShah Жыл бұрын
@@rinket7779 Ah yes, fair point -- yeah if the object has not yet been constructed, we will not call the destructor from the constructor in the case of an exception. Agreed showing the try/catch/finally within the constructor does not demonstrate that behavior! Perhaps a deep dive video into exceptions in the future I will amend this :)