Back To Basics: C++ Containers

Поделиться
HTML-код
  • Опубликовано: 13 янв 2025

Комментарии • 404

  • @javidx9
    @javidx9  3 года назад +111

    I was recently pleasantly surprised to be invited to have a chat with the guys on CppCast! You can listen to how I lowered the tone in general here: cppcast.com/one-lone-coder/ A big thanks to Rob and Jason for giving me the opportunity, they were great guys and it was great fun :D

    • @xXGskillsniperXx
      @xXGskillsniperXx 3 года назад +3

      My favorite c++ youtubers making a podcast == ❤️

    • @20thCB
      @20thCB 3 года назад +3

      I listened to the whole thing! Congratulations on the new arrival :-)

    • @treyquattro
      @treyquattro 3 года назад +3

      massive kudos! Jason is my go-to (no, not goto) resource for keeping up to date with the language. I'll check out the podcast.

    • @samuelcampbell6559
      @samuelcampbell6559 3 года назад +1

      Napping is a thing, podcasts are a thing, coding is a thing and enjoying your videos is also a thing. If only there was a way I could smash all of these pursuits together... There is!

    • @jonedwards3827
      @jonedwards3827 3 года назад +1

      I thought it was a great listen, both on your philosophy towards getting people into coding and very interesting generally on robot work and PhD, congrats too, much appreciated, leaning lots.

  • @anonanon3066
    @anonanon3066 3 года назад +315

    One of my favourite things about your content is that you show that C++, a language generally known to be "complicated and unwieldly", can be one of the most elegant and beautiful languages out there.

    • @fastmovingvolcanomatter
      @fastmovingvolcanomatter 3 года назад +39

      I don't know that "elegant" is the word I'd use to describe the language itself. I think the extreme flexibility afforded by how precise you can be in programming to your exact needs lends itself well to providing opportunities to write elegant code, but the language as a whole isn't elegant I don't think.
      Like, think about all the duplicate functionality C++ has from C backwards compatibility (mostly to do with pointer and memory management stuff). Or some of the semi-duplicate specifiers like struct and class (only difference is being private vs public by default, both of which already exist as dedicated keywords to serve this exact purpose), or typename and class in template definitions (whose few differences are slowly being removed even now). Then there's template specializations and metaprogramming as a whole, the Concepts spec being introduced in C++20, etc. It's all kind of a mess, really.

    • @x-seronis-x
      @x-seronis-x 3 года назад +9

      All things possess beauty. Its a matter of having the proper perspective

    • @anonanon3066
      @anonanon3066 3 года назад +17

      @@fastmovingvolcanomatter I agree. This whole template thing is one big shit show.
      You can write a function for arbitrary types, but only if you put the function body in-class.
      Oh, you want to put the code in the classes .cpp? Now you have to declare beforehand what types T should be, basically removing the point of templates...
      And now these concepts... Why couldn't I just do
      template
      T Add(T a, T b) { return a + b;}
      and the compiler would reject all instances where T does not have the dependent functions? Like, operator+...
      Why would I have to write a big mess of template requirements std::is_numeric, etc... All the information is there...

    • @RogueShadowTCN
      @RogueShadowTCN 3 года назад +12

      Don't be fooled! He keeps it on the simple side on purpose!

    • @arielespindola1759
      @arielespindola1759 3 года назад +6

      C++ should be used and seen as a modern language these days... and yes, it is so elegant

  • @chrisroode
    @chrisroode 3 года назад +238

    I’m a completely self taught programmer, and this video did such a great job at filling in so many gaps! You are a great teacher!

    • @Meskalin_
      @Meskalin_ 3 года назад +5

      same!

    • @jakubpluhacek3779
      @jakubpluhacek3779 3 года назад +5

      Go do some codewars and look at people's solutions! They often use so many useful functions/objects from standard library and mostly explain why they do so.

    • @jkligel
      @jkligel 3 года назад +2

      Well stated. Completely agree

    • @happygofishing
      @happygofishing Год назад

      Although im studying networking, ive had no programming education so this is a greatly useful channel!

  • @NatalisYT
    @NatalisYT 3 года назад +115

    You are truly one of the best teachers of programming and C++ around, we are all very fortunate to have you and I hope you continue to make beginner/intermediate videos like this to help make this nightmarish language more accessable to more people. Another great video, thank you!

    • @javidx9
      @javidx9  3 года назад +30

      Thanks Natalis, I will be occasionally doing more "entry level" videos, but also some of the silly projects too :D

    • @mrgeebee1622
      @mrgeebee1622 3 года назад +4

      I agree, this is really good to watch, and very pedagogic. Thank you Javidx9

  • @irbaboon1979
    @irbaboon1979 3 года назад +16

    I had to learn this from a rudimentary data structures book with shoddy drawings and unsatisfactory input from my teacher in the mid 90’s - your explanations are much clearer. Although I haven’t done C/Cpp for years in my professional career I’m still enjoying the content. Keep it up!

  • @saudude3209
    @saudude3209 3 года назад +13

    As someone old enough to know how studying programming or just about any other science subjects looks like without youtube or udemy, I never forget to say that videos like this one and creators like you are a treasure.
    Even though I had successfully defended a cpp project for my engineering thesis, I have still remained at a cpp amateur/intermediate level, because of my laziness and lack of consistency in learning.
    I appreciate series like "Back To Basics" a lot. Thank you for providing high quality, in-depth lessons for us for free.

  • @franciscogerardohernandezR1979
    @franciscogerardohernandezR1979 3 года назад +19

    It's pure bliss when a pro coder goes back to explain basics. A C++20 tutorial using your pixel engine would be a beast. Regards and great work!

  • @pythagorasaurusrex9853
    @pythagorasaurusrex9853 3 года назад +9

    I watched a lot of your c++ videos so far. I have to say: Great job. I learned C++ way back in early 90ies but stopped programming about 20 years ago. Now I started to dig out my old C++ knowledge and re-learn C++ and I see how much C++ has evolved the last 20 years with all those new std:: features. Keep up your quality!

  • @markrobinson2648
    @markrobinson2648 3 года назад +1

    I'm a C# developer who is learning C++ and your videos (particularly this one) are fantastic. Thank you for spending the time to create the videos.

  • @delqyrus2619
    @delqyrus2619 3 года назад +2

    11:01 As a physicist i would say that a vector is an arrow. The general usage as some point is absolutely confusing and doesn't make much sense. Of course, an arrow can point on some point, but in general it points to the direction of some point.

    • @javidx9
      @javidx9  3 года назад +3

      And you would be correct. Vector is a dreadful name for this data structure.

  • @JoshRosario310
    @JoshRosario310 3 года назад +2

    This is great, I learned C++ in 2005 and never touched it again until 15 years later. I never got into templates and with these containers there was a lot of syntax that made it look to me like a completely different language. I've been trying to find exactly this video with no real luck.
    I recently learned PHP and VB and thought the concept of a for..each was pretty nifty and wished I knew of a way in C++ back in the day!
    Great videos, I've been bingeing your content from the beginning over the last month.

  • @obinator9065
    @obinator9065 Год назад +1

    20:14 I’ve found that vectors crush linked lists in every single test at a higher element count, even insertion.
    If I pick a doubling capacity strategy (I believe GCC does this), I’ll make around 10 allocation and 10 memcpy() calls for the first 1000 items.
    The LinkedList will make a 1000, as this grows list will grow more inefficient in insertion time while the vector is crushing tests.

  • @TheButcher58
    @TheButcher58 3 года назад +1

    Your videos are really helpful in the sense that they do not provide a basic step by step tutorial how to implement a vector for example, but rather explain the background processes so that you understand why/when to choose a certain container type. I also like the fact that your video subjects are not necessarily related to each other but you pick a certain topic each time. This way you learn a lot of different things each video. Thank you for all the content you provide!

  • @burntt999
    @burntt999 3 года назад +1

    !!! javid you really are the man!!!! I always wanted to write something like this program in the video but wasn’t sure how to go about it. Now I can go over the program you wrote on this video line by line until I have it ingrained in memory.. jeez this channel is so incredible.

  • @xit1254
    @xit1254 3 года назад +1

    This is the best explanation of these mysterious C++ containers I've run across. I now believe I actually understand them.

  • @yusufklc7821
    @yusufklc7821 3 года назад +16

    A new video about fundamentals. Thx javidx!

  • @ZeroCool2211
    @ZeroCool2211 3 года назад +14

    Man that's exactly what I need currently 👌🏼

  • @mokoko02
    @mokoko02 3 года назад +2

    Hey just wanted to thank you for explaining these basic concepts in a ...well basic manner :) A lot of people online try to over-complicate things so your style of teaching helps me a lot.

    • @javidx9
      @javidx9  3 года назад

      Hey my pleasure buddy!

  • @danieloliveira9815
    @danieloliveira9815 3 года назад +3

    Im a junior web dev and I don't understand most of your videos, but still I don't miss one because the way you explain is so entertaining :D

  • @firepro20
    @firepro20 3 года назад +1

    I'm just getting started in C++ and your calm approach encourages me to learn more and not be afraid of the most complex / unforgiving programming language. Thank you and please continue making more videos! :D

  • @jorgeferreira6727
    @jorgeferreira6727 3 года назад

    The "vector" took me by surprise. I really didn't expect it to be moving around so soon.
    I was watching just to review, as in "dusting out", some concepts, and maybe catching up with something new from the more recent C++ standards, and got kicked in the back by that old std::vector.
    Thank you for the inside details you show in your videos. After 30+ years there is still something to be learned.

    • @bumbarabun
      @bumbarabun 2 года назад

      "I really didn't expect it to be moving around so soon." it is under your control, if you know in advance there would be much more elements - reserve capacity and it will not reallocate.

  • @magisteriumemporium1411
    @magisteriumemporium1411 3 года назад +1

    Mr. Beautiful beard man strikes my heart again>
    THANK YOU FOR THIS.
    You are in my opinion one of the best, if not the best, people out there for content to watch. Thank you so much for what you have done for the community

  • @kevinz1991
    @kevinz1991 3 года назад +3

    I appreciate that JAVID9X doesn’t like to “patronize” those who learn from him and appreciate how he empowers the coder to think about how the program runs for him or herself.
    With that being said... these “Back to basic” videos... especially the pointers tutorial and this containers tutorial... are extremely helpful in understanding even the most basic games on OLC if you are not a C++ wizard. I would highly recommend anyone reading this comment to go watch how the Tetris game is made and how the Tetris blocks are indexed. It makes even some of the most sophisticated games on OLC make sense to me. Anyways hope this helps someone cause I was really frustrated at first trying to learn this stuff, thank you so much javid9x

    • @javidx9
      @javidx9  3 года назад +1

      It's so important to learn how to debug, and the only way to do that is developing an understanding of what goes on behind the scenes. Digging yourself out of a hole is a really important programming skill.

  • @abhiz93
    @abhiz93 3 года назад +1

    I had to learn vectors when I started to prepare for interviews. Even the most basic questions couldn't be done without vectors on HackerRank. Thanks for this primer! Much appreciated.

  • @Thinzy
    @Thinzy 3 года назад +9

    thank you so much for what you've provided us all with. Your explanations make everything so simple to understand

  • @doriancorr
    @doriancorr Год назад +1

    I've been a professional developer since the eighties. Your videos are all top notch. Kudos and I'm already a subscriber but I would have signed up with this one as well.
    Well done!

  • @davideriemma180
    @davideriemma180 3 года назад +1

    The timing of this video is perfect: right when i needed. i feel like this is one of the channel that covers C++ and algorithm on a very detailed and easy to understand way! Thank you so much!

  • @thecakeredux
    @thecakeredux 3 года назад +6

    This video is such a useful ressource. Immediate classic.

  • @seanmenzies1986
    @seanmenzies1986 3 года назад

    Fantastic video. "A deque is like a linked list of arrays". Light bulb moment! Thank you so much!

  • @benjamink
    @benjamink 3 года назад +1

    I program in C and hate C++ because it's so complex and has tons of features to learn, but I think after watching this video that it is actually possible. Great explanation and thanks

  • @CodingCardSharp
    @CodingCardSharp 3 года назад +1

    Thank you for uploading this; it's a really useful resource on my own learning journey! I started C++ from scratch on a part-time basis in Sept 2020, and have basically been beasting arrays (of the 1D and multi-dimensional variety), loops, basic recursion, and some very simple classes/structs since. It was a linear learning process, including working out the 'easier' problem solving exercises. However, the next step up demands more...I dipped my toe in the murky waters of STL, and had it bitten off by some of the coding problems that demand their usage; so it's great to see the containers explained in a manner that sticks ice-cubes down the back of the learning fatigue that had set in. Your channel does for complicated programming concepts what something like 'Grokking Algorithms' did very for the far more elementary.

  • @TankorSmash
    @TankorSmash 3 года назад +4

    14:15 to everyone wondering, he called his vector, container not the other way around. Threw me for a loop for a sec

  • @Windeycastle
    @Windeycastle Год назад

    This was a great video! As a beginner, I've wondered how you should store multiple values in one variable. In Python, it's easy, but in C++ you have to choose what types fits your needs. I like it!

  • @mehtubbhai9709
    @mehtubbhai9709 Год назад

    Loved your explanation on this topic. Please do more C++ back to basics videos. Good teachers like you are much appreciated. Cheers!

  • @artemiasalina1860
    @artemiasalina1860 7 месяцев назад

    Thanks for mentioning the "auto for loop" technique! I wasn't aware of that and have just changed all the code in my project to use them. They work fine and look much nicer!

  • @arielespindola1759
    @arielespindola1759 3 года назад +21

    It was posted four minutes ago, I haven’t watched it, and I already liked it!

    • @peter881
      @peter881 3 года назад +3

      My respect for people who disliked📉

  • @DFPercush
    @DFPercush 3 года назад +38

    Any chance of getting into the C++20 stuff with concepts, coroutines, and piping operators?

  • @brucewayne2480
    @brucewayne2480 3 года назад

    Great video ! I studied C++ a little bit at university and now I'm using javascript and typescript. Back to the basics is essential.

  • @chiefthebeast9343
    @chiefthebeast9343 3 года назад +1

    Thank you so much! I am teaching myself c++ and I am at vectors and you explained everything I am learning about in this one video!

  • @inlandchris1
    @inlandchris1 2 года назад

    Very good instructions. I use to hand make Link List in the mid 1990's and considered them extremely fast. Now, looks like all the hard work is pre-made making C++ a higher level programming language. I am very late as COVID delayed my programming works as I went to build some muscles instead. Thank you for this and look forward following you.

  • @harishkulkarni7244
    @harishkulkarni7244 2 года назад +1

    Thanks for the wonderful explanation on C++ containers. I have a minor comment at 6:12, operator[] of std::array doesn't do bound checking and the behaviour on accessing a non existent element is undefined. However at() member function does bound checking and throws an std::out_of_range exception if position is not within the range.

  • @jvsnyc
    @jvsnyc 3 года назад

    I love ya already -- due to lexical coincidence, I accidentally thought your channel was about Java 9 with indexes, but now I know better! ~4:34, I would be careful about showing that as 'a + 17 * sizeof(int)' as due to pointer arithmetic, in C++ we would write that as simply 'a + 17' with the multiply by sizeof(int) being implicit. This isn't immediately obvious to those who don't come from a primarily C/C++ background, and could be forgotten by those who jump from language to language. That is, a[17] is always equivalent to *(a + 17) with no sizeof in sight, obvious to you and me, but something that can be forgotten to great detriment by beginners.

  • @proud22beme
    @proud22beme 3 года назад

    this video is a godsend! i am self taught, so there is some knowledge gaps, prior to this i have mainly paid attention to time complexity, but the way you explain the memory allocation for each container is so good in this! learned a ton from it

  • @WikiKar
    @WikiKar 9 месяцев назад

    16:39 I think that's exactly why we use .reserve(). It allows us to skip these reallocations if we, more or less. know what the size of a vector will be, or we know that there will be several items added to a vector in a sec so there's no point in setting capacity to default value.

  • @Artintrex
    @Artintrex 3 года назад +1

    I already have a good understanding of stl library but still this is the best explanation I've seen so far. Can't help but feel jealous of people learning them from you for the first time.
    Though I still prefer vector over deque; you can allocate a larger vector beforehand which also causes vector to grow by larger steps, also removing elements by moving the last element to the middle and doing a pop back solves the performance issue. Another tip is these containers do not automatically shrink, so a vector is pretty much just as fast as a regular array as long as you don't cause it to grow again.

  • @hiimdaisy946
    @hiimdaisy946 3 года назад

    0:11 - C++ Containers Main Containers
    5:08 - std::array
    10:45 - std::vector
    18:27 - std::list
    21:55 - std::deque
    24:34 - std::set & std::unordered_set
    27:57 - std::map & std::unordered_map

  • @scharpmeister
    @scharpmeister 3 года назад

    Amazing. In the midst of losing my mind debugging this vector indexing problem, this just pops up in my recommendations👌🏻

  • @jaitjacob
    @jaitjacob Год назад

    thank you for making such a comprehensive yet easy to understand video! you are a great teacher.

  • @GilFavor101
    @GilFavor101 3 года назад

    At 13:00. NOOOO, I spent the last couple days working on a tic tac toe game using `std::vector` and putting smart pointers inside it! I had a feelling there was going to be a problem, I just didn't know what it would be, or when I would find it. I FOUND IT, lol. Okay, so I can initialize it to a fixed size. Might as well use std::array then though, I think. Love this, please do another "Back to Basics" : ) Edit: In case anyone is curious, my `std::vector` was to hold smart pointers to `player` objects, of which, the amount of players is set at the beginning prompts such as "How many players?" in the CLI. Edit 2: This video is so great, thank you for making this one!

    • @javidx9
      @javidx9  3 года назад +2

      Putting smart pointers in a vector is just fine. Having pointers to vector elements is risky.

  • @thebasicmaterialsproject1892
    @thebasicmaterialsproject1892 3 года назад

    Nothing better than a bit of back to basics

  • @seditt5146
    @seditt5146 3 года назад +3

    Standard Vector is a work of art people don't give credit to that it deserves. Once you dig in and really see what is inside and then see the absolutely tiny amount of code it gives you really start to appreciate it for what it is. It gives the ability to have an extremely flexible array and it takes hundreds if not thousands of lines of code in order to produce literally 10 lines or so of assembly for doing exactly what it was you were attempting to do. Unless someone has a specific use case in their mind they would be hard pressed to write a better implementation.

  • @neefofway8746
    @neefofway8746 3 года назад

    I appreciate what you do Javid, I owe everything I know about c++ and programming in general to you. Keep it up brother!

  • @leanderperera8467
    @leanderperera8467 2 года назад

    Excellent overview of C++ containers and their internals and efficiency. Thank you.

  • @geraltt1455
    @geraltt1455 3 года назад +1

    like your videos, they have philosophical atmosphere

  • @brendinventer6407
    @brendinventer6407 3 года назад

    You really need to make a C++ game development course. Your teaching approach is so so good. Thank you!

  • @thalescarl1589
    @thalescarl1589 3 года назад

    Awesome video. I don't think we can find other content with this much quality on RUclips. Please make this a series explaining the basics for us.

  • @uzkjhgfdsewr
    @uzkjhgfdsewr 3 года назад +1

    What I'm learning here is less of STL-containers having weird consequences, I'm learning about pointers having weird consequences (so you should use them only if needed and only if encapsulatable).

  • @computerprogrammer7942
    @computerprogrammer7942 3 года назад

    He made this video at the right time when everybody needed it, what a genius!

  • @archie9500
    @archie9500 3 года назад +3

    Just what I needed when messing around with maps of bucketed linked lists!

  • @arnocr01
    @arnocr01 2 года назад

    more back to basics please! you explain things so well. i wish i had your videos back in college instead of a dry textbook.

  • @donnyp
    @donnyp 2 года назад +1

    Clear and precise, thank you sir

  • @durrcodurr
    @durrcodurr 11 месяцев назад

    What std::vector does, can easily be found out by reading its source code. Many implementations by default reallocate the vector for every element added at the end of the vector. The solution for this is to create your own vector scaling policy (for instance, automatic exponential scaling). This is done by using the capacity() and reserve() methods of the vector class. Since many programmers are oblivious to this, improperly written C++ code using the vector class can get really slow. Apparently, modern implementations (like for C++20) now finally use at least quadratic exponentiation when scaling up vectors.

  • @davidjulitz7446
    @davidjulitz7446 2 года назад

    In the "good old days", we implemented those containers by ourselves and often enough ended up in a mess. Good that modern C++ changed this. On the other hand to reinvent those containers might help to learn some bits. However, nice and helpful video.

  • @liamsmith7052
    @liamsmith7052 3 года назад

    For me as a .NET developer switching to RAII C family your tutorials are very helpful. Thanks a lot)

  • @NormHen5413
    @NormHen5413 3 года назад

    These beginner level concepts are super helpful, thanks for posting Javid

  • @AntonioZL
    @AntonioZL 3 года назад +1

    In the same way as Python is elegant due to it's simplicity, Cpp is elegant due to how precise it is. Beautiful language.

  • @ArisAlamanos
    @ArisAlamanos 3 года назад +1

    Yet another great video from an excellent channel! I admire your dedication and passion. Keep up the good work!

    • @nunyobiznez875
      @nunyobiznez875 3 года назад

      Code::Blocks is fairly easy to setup and supports different compilers. It's a good IDE, and it also has tools for wxWidgets as well, which may also come in handy for you at some point as well.

  • @cheaterman49
    @cheaterman49 3 года назад +1

    I'm only 10 mins in and already love the primer on modern C++, hahaha! So many things one doesn't know when they only learned C++98 :-)

  • @JorgeLuis-ts6qp
    @JorgeLuis-ts6qp 3 года назад +1

    I have seen line 23 in 9:40 implemented as
    𝚏𝚘𝚛( 𝚊𝚞𝚝𝚘 && 𝚒 : 𝚋)
    Why would I want to have a double pointer? Which iteration is better?

  • @anouarbagent2511
    @anouarbagent2511 3 года назад

    this is one the those channels that you automatically leave a like in any of its videos without even thinking.

  • @Crystan
    @Crystan 3 года назад +1

    I was genuinely surprised when I saw what happened at 16:20. The odds of it returning to its original spot must be close to a million to one.

  • @77Zamien
    @77Zamien 3 года назад

    Great content! I have been learning C++ for a while and this was an excelent summary of the containers!

  • @anonanon3066
    @anonanon3066 3 года назад +4

    Thanks for providing this information for free!

  • @bumbarabun
    @bumbarabun 2 года назад +2

    Great that you provide lessons on C++! Unfortunately you have some inaccuracies in your explaining. It could look small but problem is quite often stays very long in mind of novice programmers that learn from you. Like "a is a pointer", no it is not. And int is not mandatory 4 bytes in C++. And std::list has method size() which does not iterate over elements to calculate it. And `std::array` is not obligated to emit error in out of bounds access of operator[] in debug mode, it just happens in this particular implementation, but we cannot rely on that. Yes those are small discrepancies, but unfortunately C++ is very demanding language and misunderstanding some concepts could be quite expensive. Please do not take my comment as trying to discourage you, you are doing great job, I just want your courses to be even better.

  • @thomasjefferson6225
    @thomasjefferson6225 2 года назад

    coming from python, and starting to learn c++.... this video made so much sense.

  • @Finkelfunk
    @Finkelfunk 2 года назад

    Can I just say that you are doing a fantastic job teaching these types of complex concepts? :)

  • @tezza48
    @tezza48 3 года назад +2

    Fantastic video Javid :) I always pick up a few gems i didn't know!

    • @javidx9
      @javidx9  3 года назад +1

      Thanks Tezza!

  • @defaultdefault3995
    @defaultdefault3995 3 года назад

    At 8:40 line 13 would it be better, for large arrays at least, to hold b.size() in a variable and use it as a stop condition instead of calling b.size() for each iteration of the loop?

  • @ΤΛΞ
    @ΤΛΞ 3 года назад

    I don’t even program in C++ but I watch all your videos because they are great

  • @robwatson826
    @robwatson826 3 года назад

    That was a really interesting video and great to get some deeper understanding on how these data structures store their values, thanks for sharing!

  • @lercenico8260
    @lercenico8260 3 года назад +1

    congrats on 256k subscribers ✌️

  • @andrewphi4958
    @andrewphi4958 3 года назад

    Wow! Your speech pace and tone are just great and reminded me of techmoan so much! ))

  • @GrandNebSmada
    @GrandNebSmada 3 года назад

    Every time you have the idea to do a video like this, you should do it 1 week earlier, because we literally just went over linked lists in my CS class and this would have been really great to watch ahead of time haha. Great video as always!!

  • @happyredmapleleaf
    @happyredmapleleaf 3 года назад +21

    Let’s goooo another video for my skill level XD

  • @KingGrio
    @KingGrio 3 года назад

    Thanks ever so much Javid for this video. I have not been properly trained in C++ and I find a lot of RUclips tutorials provide contrived examples that do not really help understand when something is useful. Your videos always provide some context and I always feel like I got a clearer picture of how things work internally and what is and isn't good practice. Although because of my lack of knowledge it does take me a long time viewing your different videos to process all the information and finally "get it".
    If you ever have some time, I would be tremendously happy if you could break down the VST plugin framework for us. I have a lot of trouble understanding things like "extern C", or how virtual classes are used for versioning or inheritance, or how threads are started somewhere and how/where you should write code to pass your audio data to the plugin and so on.

  • @qazarl
    @qazarl 3 года назад +6

    12:45 vector actually tries to std::move your elements, unless they are trivially copyable or not noexcept movable :)

  • @nathanbanks2354
    @nathanbanks2354 2 года назад

    After switching from Java/Python to C++ for a project, this is incredibly useful. Wish I watched it ages ago!
    It seems as if C++ is borrowing cool stuff from other languages, but the notation is super weird because it still has to be backwards compatible with C programs. I've never really missed the auto keyword in Java, though I do use Array instead of Array sometimes.

  • @davifn6625
    @davifn6625 3 года назад +1

    Correction: at around 4:20, a[7] actually points to the eighth element of the array instead of the seventh

    • @davifn6625
      @davifn6625 3 года назад +1

      Also I don't see how the list container couldn't keep count of how many elements are in the list

    • @davidfrischknecht8261
      @davidfrischknecht8261 3 года назад +1

      @@davifn6625 It's implemented using a regular doubly-linked list. Each node only has the value itself and pointers to the previous and next nodes.

    • @davifn6625
      @davifn6625 3 года назад +1

      @@davidfrischknecht8261, I know how it is implemented. I am just pointing out that there is no reason the implementation couldn't keep count of how many items there are in the list, as javid said

    • @javidx9
      @javidx9  3 года назад +1

      Its tricky because of the more advanced container operations. For example you can merge and splice lists, or sub lists and ranges, In these instances there is nothing describing how many nodes are in those sequences, yet the operation can complete without walking them (just through pointer adjustment of head and tail).

    • @davifn6625
      @davifn6625 3 года назад

      @@javidx9, got it. Thanks for clarifying

  • @ZizoAhmed
    @ZizoAhmed 3 года назад +1

    Finally a video I can complete on this channel . xD

  • @justasydefix6251
    @justasydefix6251 3 года назад

    These videos are too precious! we must copy them into a vector.

  • @Idlecodex
    @Idlecodex 3 года назад

    CppCast?! Great crossover! I’m going to check that in 31’41”!

  • @dahuskey81
    @dahuskey81 3 года назад +1

    Hey Mr. J, No this is not batman, but a big fan of your work. I am not a big fan of paying people for content, not that I am against it, just some of the stuff I really don't feel there is enough value to cough up hard earned money .....
    Until I saw your channel.
    I enjoy watch it, not only for serious stuff, but your humor. People think think coders do not have a sense of humor ** insert robot picture here **
    Because of you I am not going to have to make an account on Patreon, and "Yes, open up my checkbook" Gahhhh
    :) :) :)
    Keep up the good work man I love this stuff!! Now "Robin! To the Batcave!!"

    • @javidx9
      @javidx9  3 года назад

      Thank you for your kind words 😊

  • @H3liosphan
    @H3liosphan 3 года назад

    This is great. Thanks! I 'learned' C++ in the mid 90s, pretty sure std::array, std::vector and std::deque weren't around then! Amazing modern improvements. mostly I used standard C and more lately C#, which appears to have many similarities to this, but I'd imagine is burdened more by MS and .NET added latencies. There's a reason the Unreal Engine was built in C++.

  • @manuelnovella39
    @manuelnovella39 3 года назад

    Wow! I loved your video, really. Donald Knuth would be pretty happy, I think. More on data structures, please? Maybe going in depth on the use of sets and maps or covering trees and graphs? That'd be awesome. In my opinion, trees deserve a whole separate video

  • @jacopopecchini2267
    @jacopopecchini2267 2 года назад

    THank you! this helped a lot understanding containers. I would also print che container's capacity, because for vectors it is interesting to see how it doubles every time the size hits the capacity limit.

    • @javidx9
      @javidx9  2 года назад

      Thanks, doubling is just one strategy that empirically turns out to be reasonably efficient. Different implementations may not always double.

  • @jgurtz
    @jgurtz 3 года назад

    Thanks for the great introduction to some standard containers!

  • @n0handles
    @n0handles 3 года назад

    This also was a great review on data structures. Thanks for another great video!

  • @Djinn667
    @Djinn667 2 года назад

    This was an amazing lecture! Keep up the good work!

  • @nedelcucosmin3087
    @nedelcucosmin3087 3 года назад

    a good idea for the future it would be to talk a little bit about the complexities of adding/removing/accessing elements in the respective container

  • @alexrobertson35
    @alexrobertson35 3 года назад +5

    Congratulations on the event from the episode, dw I won't say what it is. people need to listen to the podcast for that :P

    • @Errorcode-hq5wg
      @Errorcode-hq5wg 3 года назад +4

      Yes, I think he's gonna be a great [redacted]

    • @thecakeredux
      @thecakeredux 3 года назад +2

      @@Errorcode-hq5wg Enough to deduce it. Nice!