Back To Basics: C++ Containers

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

Комментарии • 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 года назад +308

    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 года назад +235

    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 2 года назад +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 года назад +114

    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.

  • @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!

  • @franciscogerardohernandezr4788
    @franciscogerardohernandezr4788 3 года назад +18

    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!

  • @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.

  • @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!

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

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

  • @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.

  • @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.

  • @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

  • @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!

  • @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.

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

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

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

    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!

  • @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.

  • @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

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

    A new video about fundamentals. Thx javidx!

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

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

  • @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

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

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

  • @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!

  • @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.

  • @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

  • @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

  • @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📉

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

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

  • @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.

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

    This video is such a useful ressource. Immediate classic.

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

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

  • @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!

  • @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

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

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

  • @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.

  • @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.

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

    Nothing better than a bit of back to basics

  • @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

  • @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!

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

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

  • @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!

  • @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.

  • @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.

  • @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.

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

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

  • @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).

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

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

  • @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.

  • @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.

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

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

  • @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.

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

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

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

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

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

    like your videos, they have philosophical atmosphere

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

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

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

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

  • @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.

  • @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.

  • @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

  • @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.

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

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

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

    Clear and precise, thank you sir

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

    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.

  • @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!

  • @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.

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

    I was expecting to see some sort of c++ "made from scratch" docker or something xD
    I only knew Java Collections, so it was nice to learn what c++ has to offer

  • @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

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

    Thanks for the great introduction to some standard containers!

  • @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.

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

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

  • @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 :-)

  • @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!

  • @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.

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

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

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

    Finally a video I can complete on this channel . xD

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

    Let’s goooo another video for my skill level XD

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

    It's awesome that you're talking about containers, that's something that universities here in Brazil should at least talk about in the courses with C++.
    Unfortunately, here there are a lot of people stuck in C++98 because of what they've learned at university introductory classes.

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

      To be fair, most of the containers were already there in C++ 98 (which a lot of people call C++ 03 now, tho I don't)...so it is even worse than that.

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

      @@jvsnyc I didn't know that, it's really worse than I thought.

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

      @@mateuscoutinhomarim9184 it explains why they say c/c++, their c++ looks more like c than modern c++.

  • @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.

  • @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++.

  • @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.

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

    Thanks for providing this information for free!

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

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

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

    Alternative title: Data Structures in C++ tutorial

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

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

  • @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.

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

    This also was a great review on data structures. Thanks for another great 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.

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

    Clear and concise! I've been using the wrong data structures ; ;

  • @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!!

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

    I don't know if it would be of interest to you, but I think that would be great a video talking about the C++ algorithms support for multithreading, it makes my life a lot easier when I have to do a good amount of processing.

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

    That random number generator was hilarious 😂

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

      well its uselessness proved useful later on :D

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

    more videos on basics like this plz

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

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

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

      Thanks Tezza!

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

    The comments on the Random Number Generator were funny as hell! 🤣

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

    Thank you for another interesting video! I'd be really interested in more videos on proceduraly generated content and especially on how to "save" the users interactions with the proceduraly generated content. And to go even further it would be very interesting to know if one could proceduraly generate agents, besides the user, who interact with each other and the rest of the content independently of the user, as well as with the user.