This deserves more views. It is to the point without fluff. You keep saying it was getting long but I think a lot of other people would take longer to explain the same concepts, and yet you still managed to actually explain everything clearly. I did have to pause and re-watch the part about the stack but I really learned a lot from watching this. Thank you :)
Thanks for the feedback! I just re-watched the stack part and I do agree that I should've explained that part simpler, it was a little bit too confusing! Also, I'm sorry about the echo and me cutting off the ends of most lines in this video, both of those have been fixed for future videos. Please feel free to tell me what other topics you would like me to cover. I know the most about C#, C++, HTML/CSS/JS and Assembly, so any topics in those sorts of areas I would happily look into covering :)
@@rdawson3648 Sure thing! Once I'm finished with the PowerShell series I'm doing now, I'm going to start focusing my channel's attention over to primarily .NET internals and more advanced C# topics like that. And interfacing between C++ and C# _definitely_ sounds like something that would fit the general theme of that. It may take a while for me to get to it, as there are still a few PowerShell videos to go, but I'll keep your suggestion in mind!
@@omg33ky Yep, still got plans to make all these! I've been really pre-occupied with some other stuff but I want to pick ABMedia back up soon, and when I do I've got two videos on PowerShell left, and then... It's all .NET internals from there on out!
This is brilliant! Perfect clarification material for java programmer, such as myself, who knows all the "basic" stuff and just wants to understand difference in principals. 10/10 😍
This is by far the best C++ introduction video I have ever found. As a reasonably advanced C# developer, I always tend to loose my concentration with these kind of topics because they often are too simple and go over stuff I already know, but this one is perfect. I hope to see more advanced videos of C++ from you. As a kid I programmed a lot in Borland Turbo Assembler but once we got Windows 95 and protected mode everything changed and I basically had to start from scratch all over again, therefore I kind of lost interest in it. Lately I rediscovered programming at a low level again and I'm trying to learn C++ and, perhaps, assembly language again just because it is way more fun then C# with all its abstractions, packages and other under the hood stuff I cannot control. If you ever find the time and its fun for you I would love to see an introduction video on assembly language and how it's done nowadays. Anyway, thank you very much for this video, it really made my day!
Thanks, I'm glad you like it! So, the plan for the channel is I'm going to get the PowerShell series done, and then from there I'm actually going to specially focus on lower-level concepts with respect to C#. How various pieces of .NET internally works, how to write high-performance code in it, an analysis of stuff like JIT output (which will involve me looking at assembly) etc. That's the current plan, but there's always room for more C++ things at some point
@@ABCo-ABMedia That sounds great, I'm looking forward to it. The PowerShell series seem interesting too, I'm trying to do more stuff with the command prompt lately instead of letting Visual Studio handle everything for me, like GIT actions for example, so I'll watch them in the near future.
this was extremely helpful, thank you! I've been studying both Java in a strict and organized course, and C++ pretty much independently. this has made so many things make much more sense to me in both especially in why the differences are the way they are.
Why does your video only have about 1k views? As a moderately experienced C# developer (hobbyist) i found this extremely helpful. It's not too long at all and pretty much everything i struggled with at the beginning makes sense now. There are not a lot of videos like these, the ones that cover C++ are usually from a beginners point of view and cover everything including basics, which someone who already has experience in higher-level and managed languages already knows. Keep it up you got a sub. 👍👍👍
Thanks a lot, I'm glad you found it useful! And about the 1K views, it takes for these things to grow, but I don't mind. I do also think the sound in this particular video is very off-putting for many people, there's an unintentional echo on the vocals, and at some points I cut the ends of lines off too quickly, I was editing too close to the speech. I fixed those for future videos, but that probably doesn't help.
This is perfect for someone like me who's been primarily doing C# and gets confused with C++. Thank you so much! Very nice introduction to the language!
Yep - that's exactly what it was intended for! To clarify all the confusing concepts when getting into C++ coming from C#. One of the nice things is all these concepts learnt in this video do actually apply to more advanced C# too! Especially the heap vs stack, that's very good to know. I'll actually be making a dedicated video about how memory is structured inside C# soon, and one of the things in it will be stack vs heap, which is in fact sort of already covered here, just from a C++ perspective, not a C# one!
Wow, as someone who has written C# for 4 years this actually made sense. Always wanted to get into c++ but seemed daunting. But honestly it seems a lot simpler and intuitive that I thought. Great explanation on pointers. Looking forward to prototype in c++!
Great! That's exactly the intention of the video, to help make C++ feel more accessible to C# developers! By the way, even if you don't write C++ code, a lot of the info learned here can also be carried over to C#, since C# has pointers in the form of unsafe and the stack vs heap isn't any different in C#, the only difference is in C# the way it works is "reference types" (classes) are passed around as pointers to the heap and "value types" (structs) always have their contents placed where you put them (be it on the stack if they're in a local variable, or in the middle of a class on the heap if they're in a class), so that's something to think about!
Same here. It's like a paradigm shift though, and we'd have to be extra careful to consider the pitfalls outlined in this video when writing actual C++ code. Memory leaks scare me, LOL.
@@graceoverall Yep, you do definitely have to be very careful! It's why I prefer C# first for most things, and only use C++ if it really is suited to a given task.
@@ABCo-ABMedia Aye! I'm considering applying for a position at my company where I'd be maintaining a fairly mature low level software written largely in C++, but as a C# dev with no real experience in C++, so I came here to see if that's a realistic endeavor. I'm still assessing. 😉
Amazing content man! I have always been a mid/high level developer (C#, Kotlin, Javascript, etc.) and am getting into C++ for Unreal, but thanks to this kind of explaniations I am becoming a C++ lover. Suscribers++
Yeah well, that's why I made this video - there are lots of beginners tutorials out there but if you're always experienced with C# or Java you don't need that, you just need to learn the differences
Having programmed C++ professionally in the late 1990s and now preparing for a new C++ project, I really enjoyed this recap. Highly recommended (and easily found when searching for »c++ for java programmers«) 👍 The only issue I had was with the distracting echo on the audio. Minor note: at 24:46, the call should read SecondMethod(&a) since a pointer to the MyClass instance needs to be passed.
Yep, that was a mistake, a few other people have pointed it out in the comments! There *should be* a card in the top-right correcting it. I'm glad you like the content regardless! With regards to the echo, I know, it is really unfortunate and it was not intentional. Delay built into the mic, I didn't check it before recording, recording ruined
Damn, very good video! 2 times speed with some knowledge of c++ before and it was perfect! Worth noted I have programming experience and data/hardware experience as well.
This is a really great helpful video for a C# programmer myself. I was having trouble understanding about pointers and header files the last time I was learning C++, until I watched this video. I thought pointers were pointless before, because I didn't know passing an object to a method would make a copy of the said object in C++, since I was used to assuming that objects would be passed as references. I've heard about C++ programs about having memory leaks before, and the heap explanation helped me understand it. I'll be having my first year in Computer Science next month, and this video really helped me and gave me a head start. I rarely comment on RUclips videos, and I just want let you know how thankful I am for this video! ^^
Amazing! I have tried to learn C/C++ for a long time now and never managed to get a great understanding for how the stack, heap, pointers, etc... all function and come together. This video is so great because it relates everything together while showing what syntax does what so viewers will actually be able to see how their code works at a fundamental level. This is an amazing video and I will make sure to show it to anyone who wants to learn C or C++ (I know they are different languages in that they aren't both OOP and have some different syntax but the parts about pointers, the heap, and the stack should be conceptually similar).
I've been developing with C# and such for quite a while now and I've never understood the use of pointers. But this video made so much sense of it in such a simple, short way! Great video👌
I am learning c++ and this video was really really helpful in explaining some of the key concepts I couldn't find any explanation for anywhere..... Thany you. Love your work.....
Amazing video, I appreciate this so much. I'm starting college in about a month and I'm skipping straight to the second CS class because of AP credit I got during high school. the issue is that my high school classes all worked with java, while my college is gonna work with c++. so basically this is helping me a ton. Great job on this video and thanks so much
An absolutely awesome video! Coming from Java, C#, and C, you have answered so many tedious questions that come up that are often overlooked or left to the person to figure out for themselves. Honestly, universities should pickup this style of teaching as it's the most effective 39 minutes and 46 seconds of my life.
@@ABCo-ABMedia I apologize for the late reply! I didn't receive a notification from RUclips and just saw this. Personally, I would love to see a video (or a series) that discusses various types of language compilers and/or interpreters for select languages. For example, LLVM and Clang for C and C++, Java AOT compilers, JIT vs AOT, and etc. Another potential topic could be automation through scripting. An example would be creating simple utility scripts on a particular OS to manage sorting of files given select parameters, a file-janitor that relocates the least used files in a particular directory to an "unused folder", periodic folder compression manager, and more.
This is so freaking awesome! Finally this made sense to me. Seriously hope there are more videos on your channel like this. Thank you VERY much for the awesome video! :)
So concise, love it! Question: at ~14:40 shouldn’t the call to SecondMethod be changed to “SecondMethod(&a)” so that the address of MyClass is sent as the parameter-or since the parameter specifies that it requires a pointer, can it grab the pointer automatically?
I took C in college... Never touched C++. I struggled a bit to understand it, but was also completely new to programming. Years later I taught myself C# and ended up finding C++ too intimidating. This video is incredibly well done.. as all the elements of C++ I couldn't understand.. are explained beautifully here. It also shows me, as someone who wrote a fair bit of complex C code (obnoxious data structures exams/projects), how C++ (probably) grew over time. The 'malloc -> new' bit as one example. Super interesting and now youve got me considering picking up C++ :p
I'm glad to hear you found the video helpful and it inspired you to play with C++! Picking up C++ is definitely a nice way to expand your knowledge out further. And in fact, when I got into it ages ago, it didn't just make me better at C++, it made me better at C# too, because as I learnt about the stack vs heap and about fully using pointers etc. It all started to fill in many of the gaps I had in my knowledge about how memory is actually structured in C# too. Like the difference between class and struct. And it's what allowed me to then really get into the .NET internals, to the point where I can now safely say I know a lot now about the .NET internals and what's going on inside, and I'm definitely going to be making videos in the future about exactly that at some point! So stick around if you're interested in digging into what's going on inside C# and .NET, and such because videos about it will be coming at some point. In the meantime though, the current thing going on in the channel is the "PowerShell" video series, PowerShell is something I think is really interesting because it's literally C# in a command line form, it's built on .NET and commands give back .NET classes and such. By the way: If there's anything you'd specifically like to hear about the internals of, let me know and I'll happily prioritize it when the channel gets around to .NET internals
When I first looked at C++ there were a lot of things confusing me but now it all makes so much sense, this is a very good summary. I will ofc have to do further learning but this video is a great start for anyone coming from C#
The same thing happened to me too when I first looked at C++, and I felt there just weren't any good resources that just simply _explained_ these core concepts for an already existing C# developer well, and that's why I made this video!
Can add that anyone coming from an interpreted language would benefit! Your video makes it clear what top-down implies in the structure of C++ verses an interpreted language.
Great video, imo it had the optimal length and covered all important topics. Maybe you could‘ve mentioned smart pointers when talking about memory allocation and freeing, as these are such an important tool in memory management.
Thanks for the feedback! I wanted to keep this video to just the basic differences and didn't want to pack too much content into it. If you search for videos about plain pointers, then almost all of them are targetted at beginners, and the explanations are slow and in-depth like that, and I wanted to avoid that for people who already know C# with this video. However, there is a lot more content on _smart_ _pointers_ and such for developers who are already experienced, so I felt like putting more advanced things like that in here wasn't necessary when there's already lots of correctly levelled content. I might make some more videos on C++ in the future, however, so if there are any topics you do want me to cover, then be sure to let me know!
Thanks, and yeah I'll consider that. But part of the problem with doing that is a lot of the topics _depend_ on the topic from before so it makes people more prone to not understanding stuff.
It's worth remembering that arrays in C/C++ are literally just syntactic sugar for pointers - you can (though you probably shouldn't) put negative numbers into your square brackets to look at earlier entries in memory. If you're passing around an array, it's generally a good idea to pass the size of the array as well. This is why if you want to handle command line arguments, main needs to take a char** (basically an array of char arrays) as well as an int which lists how many char arrays are in the main array (usually named argv and argc respectively). There is no runtime bounds checking unless you add it. A C++ vector, on the other hand, while it doesn't have built in bounds checking, does at least store its own size, as well as having a number of useful methods. In most situations in C++, you should probably use a vector rather than an array, and a C++ string over a char array.
I... Already said that arrays are just pointers? And I already mentioned std:: vector... And std::string... So, what exactly are you getting at here that's new? :P
@@ABCo-ABMedia I just wanted to expand on that - the lack of built in bounds checking is a common cause of security issues in C++ code. Also, it means that in code where you don't necessarily know the length of the array (if you're writing a library, for instance), you need to have both the array and its length as separate parameters to a function (or members of a class) because there's no built in way to get that information.
This is the literally the best proof that the RUclips Algorithm is dumb and blamable. I got to see this video now!. I wonder where are those other jewels hidden because of the RUclips ineptitude. I never say this, but man your way of explanation is awesome and this video deserves more views and likes.
Haha glad to hear you liked it. And yeah I mean, in all fairness to RUclips, I don't upload enough (yet!) to compete with the larger channels that focus more on quantity over quality. But I'll be picking this channel up soon and hopefully it'll start getting even more recommendations! I don't mind too much though, as long as it reaches enough people to make a difference I'm happy!
Great video, one of the better videos for developers learning C++. I have a question though. What is the practical application for not using a pointer in a method signature? Like why would you not want to pass the pointer?
Well some types like "int" are so small that there's no point in passing them as a pointer, and you're actually just adding extra work for the CPU by doing it. And sometimes you might have types that are only 8-16 bytes, same situation. It's not too common to not pass a pointer but it definitely _can happen_ - it's why C# and Java opted for leaving which is used up to the _type_ itself and having most types being reference types (i.e. passed by a pointer)
Thanks a lot! I know, it is a really big shame about the echo, it wasn't intentional. It was a problem with my gear, but I fixed it for all of my other videos.
Really Useful Video! i feel quite confortable in C#, but am keen to add C++ to my skillset for some personal projects, this helped lots! Follow up video would be good with other tips and tricks!
Glad it was helpful. There isn't absolutely loads else to cover in a follow-up video, except templates. I'd recommend taking a look at "The Cherno" to learn more about C++, those videos are really good!
How did you manage to get a yellow rectangle around the line you are debugging? in current version of Visual Studio 2022 this only exists in c# In c++ there is only an arrow a rectangle does not appear.
Well... Given this video was made in 2020, I obviously wasn't using VS 2022 - I guess VS 2019 had it and they got rid of it (probably found it had some inaccuracies in some multi-line edge cases or something and decided it was best to get rid of it to avoid confusion)
I have worked with C++ for years but 10years ago or so I started doing D. I would say that it would be easier to go to D than C++ and it is compatible with C and C++. D or the subset of D (BetterC) is as fast C and C++ buts it is just much easier to read and maintain.
Fair enough! There are tons of languages that you could argue are better than C++, C++ is definitely a very flawed language! Still from an understanding perspective I think it's incredibly useful to know about, it definitely gives you a very unique perspective!
@@ABCo-ABMedia Most of it. Particularly the part where you need separate header files or how you can't pass object around but have to deal with the pointer bullshit. Just lmao. I'm going to use matlab to generate my cpp scripts I guess. 🤣🤣🤣
@@azgan123 Yeah the header files suck quite a bit, although it makes sense why they're necessary in terms of linkers, I think it could have *definitely* been designed a lot better. But regarding the pointers, that's just how the CPU works! When you pass an object in C#, if that object is a "reference type" (like most things in C# are), it's passing a pointer, and at least in C++ you have control over whether it does that or not, whereas in C# you're forced to it always passing by reference. C++ is very good at exposing the behaviour of the machine which can be really useful for performance, which is C++'s main focus nowadays. That being said, a lot of the performance things you can do in C++ you can do in C#, as C# has value types if you want that more fine-grained control over where things are in memory, it has optional pointers and many Unsafe APIs, it lets you allocate arrays to the stack using "stackalloc" and various other things that let you achieve almost anything you want to achieve in C++ in C#. So I personally prefer C# greatly as it lets you get very close performance to C++ if you need it.
Excellent video! Just wanted to correct a small mistake at 25:15 Mark. It should be secondMethod(&a). Let me know if I am mistaken. Thanks again for the great video!
@@ABCo-ABMedia Definitely dude. The fact that I was able to notice and correct the mistake shows that your video is both very good at teaching the stuff and keeping the viewer engaged. Kudos for the stack visualization part, made it much more clear for me than ever before. Good luck.
Im a lazy Java programmer with a C++ exam due in 2 hours which i learned nothing for (its all quite basic). We’ll see in a couple hours, but im pretty sure u just saved my exam lol. Some of these i would never have just guessed
Hi! I think there's kind of two aspects to what you just said, and I'll try my best to respond to both of them. In this video, there is a really, _really_ annoying echo - it's unprofessional, you have to get used to it at first, it turns people off the video when they first click on it, it _pains me_ knowing it's there, I really wish it wasn't... But there was nothing I could do once I recorded. I fixed the issue for future videos but the damage to this one was already done, so I just went on with it. You get used to it really quickly, but I agree, it _sucks_ - it pains me more than it pains anyone else, I can tell you that. That aspect... Yeah, I take 100% blame for. Of course, I know that's not what you were talking about, you were talking about my pronunciation of words and my voice. Now look, I won't try and argue I have a particularly good speaking voice, or that I used to pronounce "s"es right, or that 2 years ago isn't representative now. But even if you were struggling to follow along, which if you saw all the visuals you can't have been, the good news is my videos all have subtitles on them! Turn 'em on, hell, mute the sound if you really insist, and enjoy! I do, and always have done, everything I reasonably can to try and offer the best experience, so if it makes you more comfortable, I encourage you to use that instead. I'm happy that you enjoyed the visuals, and I hope the video helped you out in some way. I do appreciate the feedback, although you didn't mean it the way I'm treating it, but I assume the best. Best wishes, Alex
Glad you like it! Sorry for the late reply, RUclips didn't show this comment for a while haha. If there are any topics you also want me to look at, then please tell me!
Wow, uh, thanks? Not sure what to do about the "boyish voice"! :) Glad it was helpful though PS: If you had a problem with the echo, that's sorted out.
@@ABCo-ABMedia Sorry for that remark. Can you make a video "java for c# developers" ? There isn't that much to cover, but it would be great to have such video, because i really couldn't find one on youtube...
Haha. Someone else mentioned this in other comment funnily enough. In a sense, the video does help a bit, if it goes one-way it will naturally go the other way in some sense. But yeah there's stuff the video doesn't talk about because they're just not in C++. Best way to learn in that direction is to just get hands-on with C# and you'll get used to using it. Install Visual Studio, make a ".NET" project (not .NET Framework, just .NET) and essentially off you go. Also I'm always around on the Discord server (or these comments I suppose) if you have any questions about differences you encounter as you use C#
30 seconds in, and as an audio engineer I gotta say that reverb is waaaay too Wet Bro lol but anyways seems like a good video, gonna continue watching..
It's mostly delay but yeah there is way too much of it, I know, and it was not intentional I assure you! You'll see me mention it in a bunch of other comments, sadly just something I couldn't do anything about at the time.
@@ABCo-ABMedia Well you're video is clearly very informative if I'm able to spot mistakes by 25 mins in, with no prior experience. Thank you for the video! Is your discord still active? I can't load the page on your website.
@@morganmulholland6654 Ah that would be because the link in the description is out-of-date, I should've updated it but being a 2 year old video, must have missed it - I updated it, and yeah, the Discord still exists and of course I still pay attention to anything that happens on it _but_ it's definitely not what I'd call "active", I haven't given that Discord any real attention in ages I'm afraid. I've just been spending on my time in other places like the C# channel of The Coding Den
This deserves more views. It is to the point without fluff. You keep saying it was getting long but I think a lot of other people would take longer to explain the same concepts, and yet you still managed to actually explain everything clearly. I did have to pause and re-watch the part about the stack but I really learned a lot from watching this. Thank you :)
Thanks for the feedback! I just re-watched the stack part and I do agree that I should've explained that part simpler, it was a little bit too confusing!
Also, I'm sorry about the echo and me cutting off the ends of most lines in this video, both of those have been fixed for future videos.
Please feel free to tell me what other topics you would like me to cover. I know the most about C#, C++, HTML/CSS/JS and Assembly, so any topics in those sorts of areas I would happily look into covering :)
@@ABCo-ABMedia How about interfacing C++ from/to C# ?
@@rdawson3648 Sure thing! Once I'm finished with the PowerShell series I'm doing now, I'm going to start focusing my channel's attention over to primarily .NET internals and more advanced C# topics like that. And interfacing between C++ and C# _definitely_ sounds like something that would fit the general theme of that.
It may take a while for me to get to it, as there are still a few PowerShell videos to go, but I'll keep your suggestion in mind!
@@ABCo-ABMedia I would also like to see that video and hope it's still planned
@@omg33ky Yep, still got plans to make all these! I've been really pre-occupied with some other stuff but I want to pick ABMedia back up soon, and when I do I've got two videos on PowerShell left, and then... It's all .NET internals from there on out!
This is brilliant! Perfect clarification material for java programmer, such as myself, who knows all the "basic" stuff and just wants to understand difference in principals. 10/10 😍
Glad you found it helpful!
This is by far the best C++ introduction video I have ever found. As a reasonably advanced C# developer, I always tend to loose my concentration with these kind of topics because they often are too simple and go over stuff I already know, but this one is perfect. I hope to see more advanced videos of C++ from you. As a kid I programmed a lot in Borland Turbo Assembler but once we got Windows 95 and protected mode everything changed and I basically had to start from scratch all over again, therefore I kind of lost interest in it. Lately I rediscovered programming at a low level again and I'm trying to learn C++ and, perhaps, assembly language again just because it is way more fun then C# with all its abstractions, packages and other under the hood stuff I cannot control. If you ever find the time and its fun for you I would love to see an introduction video on assembly language and how it's done nowadays. Anyway, thank you very much for this video, it really made my day!
Thanks, I'm glad you like it!
So, the plan for the channel is I'm going to get the PowerShell series done, and then from there I'm actually going to specially focus on lower-level concepts with respect to C#. How various pieces of .NET internally works, how to write high-performance code in it, an analysis of stuff like JIT output (which will involve me looking at assembly) etc.
That's the current plan, but there's always room for more C++ things at some point
@@ABCo-ABMedia That sounds great, I'm looking forward to it. The PowerShell series seem interesting too, I'm trying to do more stuff with the command prompt lately instead of letting Visual Studio handle everything for me, like GIT actions for example, so I'll watch them in the near future.
Excellent! This video exceeded my expectations. You basically answered 100% of my questions.
Glad it was helpful!
100% agree, far more understandable than I expected
this was extremely helpful, thank you! I've been studying both Java in a strict and organized course, and C++ pretty much independently. this has made so many things make much more sense to me in both especially in why the differences are the way they are.
Glad to hear it!
This video is perfect for intermediate developers like myself, to just learn the foundation of c++ and not just “how to print hello world” etc
this is an excellent video for C# devs, well done, thank you.
The first thing to watch here is your brilliant talent in teaching. Good luck in your life.
Why does your video only have about 1k views? As a moderately experienced C# developer (hobbyist) i found this extremely helpful. It's not too long at all and pretty much everything i struggled with at the beginning makes sense now.
There are not a lot of videos like these, the ones that cover C++ are usually from a beginners point of view and cover everything including basics, which someone who already has experience in higher-level and managed languages already knows.
Keep it up you got a sub. 👍👍👍
Thanks a lot, I'm glad you found it useful!
And about the 1K views, it takes for these things to grow, but I don't mind. I do also think the sound in this particular video is very off-putting for many people, there's an unintentional echo on the vocals, and at some points I cut the ends of lines off too quickly, I was editing too close to the speech. I fixed those for future videos, but that probably doesn't help.
This is perfect for someone like me who's been primarily doing C# and gets confused with C++. Thank you so much! Very nice introduction to the language!
Yep - that's exactly what it was intended for! To clarify all the confusing concepts when getting into C++ coming from
C#.
One of the nice things is all these concepts learnt in this video do actually apply to more advanced C# too! Especially the heap vs stack, that's very good to know. I'll actually be making a dedicated video about how memory is structured inside C# soon, and one of the things in it will be stack vs heap, which is in fact sort of already covered here, just from a C++ perspective, not a C# one!
Wow, as someone who has written C# for 4 years this actually made sense. Always wanted to get into c++ but seemed daunting. But honestly it seems a lot simpler and intuitive that I thought. Great explanation on pointers. Looking forward to prototype in c++!
Great! That's exactly the intention of the video, to help make C++ feel more accessible to C# developers!
By the way, even if you don't write C++ code, a lot of the info learned here can also be carried over to C#, since C# has pointers in the form of unsafe and the stack vs heap isn't any different in C#, the only difference is in C# the way it works is "reference types" (classes) are passed around as pointers to the heap and "value types" (structs) always have their contents placed where you put them (be it on the stack if they're in a local variable, or in the middle of a class on the heap if they're in a class), so that's something to think about!
Same here. It's like a paradigm shift though, and we'd have to be extra careful to consider the pitfalls outlined in this video when writing actual C++ code. Memory leaks scare me, LOL.
@@graceoverall Yep, you do definitely have to be very careful! It's why I prefer C# first for most things, and only use C++ if it really is suited to a given task.
@@ABCo-ABMedia Aye! I'm considering applying for a position at my company where I'd be maintaining a fairly mature low level software written largely in C++, but as a C# dev with no real experience in C++, so I came here to see if that's a realistic endeavor. I'm still assessing. 😉
Amazing content man! I have always been a mid/high level developer (C#, Kotlin, Javascript, etc.) and am getting into C++ for Unreal, but thanks to this kind of explaniations I am becoming a C++ lover. Suscribers++
Great stuff man. Straight to the point, no fluff. So much better than having to go through coding basics again like in most other C++ videos. Thanks!
Yep, that's what I was going for - glad to hear it worked out!
Woah. that was quick. After 5 minutes, I learned more about C++ than I did in other beginner tutorials. Thank you so much!
Yeah well, that's why I made this video - there are lots of beginners tutorials out there but if you're always experienced with C# or Java you don't need that, you just need to learn the differences
Starting a new job in C++ in a month coming from C#, thanks for the great video homie!
Thanks for a great video. Covers some important but behind the scenes concepts that most intro videos wouldn't.
Having programmed C++ professionally in the late 1990s and now preparing for a new C++ project, I really enjoyed this recap. Highly recommended (and easily found when searching for »c++ for java programmers«) 👍 The only issue I had was with the distracting echo on the audio.
Minor note: at 24:46, the call should read SecondMethod(&a) since a pointer to the MyClass instance needs to be passed.
Yep, that was a mistake, a few other people have pointed it out in the comments! There *should be* a card in the top-right correcting it. I'm glad you like the content regardless!
With regards to the echo, I know, it is really unfortunate and it was not intentional. Delay built into the mic, I didn't check it before recording, recording ruined
One of the best that I've ever seen for java programmers learning C++. Thank you so much for this and keep doing it!
Glad you enjoyed it!
I've been stuck in PHP for years (after having started as a C++ programmer, years before that). This was awesome, thanks for your hard work!
this is the kind of video you always hope for but usually never find. Big thanks, it was excellent!
Damn, very good video! 2 times speed with some knowledge of c++ before and it was perfect! Worth noted I have programming experience and data/hardware experience as well.
Glad to hear it!
This is a really great helpful video for a C# programmer myself. I was having trouble understanding about pointers and header files the last time I was learning C++, until I watched this video. I thought pointers were pointless before, because I didn't know passing an object to a method would make a copy of the said object in C++, since I was used to assuming that objects would be passed as references. I've heard about C++ programs about having memory leaks before, and the heap explanation helped me understand it. I'll be having my first year in Computer Science next month, and this video really helped me and gave me a head start. I rarely comment on RUclips videos, and I just want let you know how thankful I am for this video! ^^
Glad it helped clarify some of those things! And yeah, pointers are certainly not pointless, they have "point" in their name after all ;)
man I wish I watched this a month ago. Answered pretty much every single problem I ran into coming from C#
Shame you caught it now, then. But still, glad to hear you think it's got the right topics!
This video has been incredibly useful in putting some context behind C++ features. Thank you!
You're welcome, glad you found it useful.
Amazing! I have tried to learn C/C++ for a long time now and never managed to get a great understanding for how the stack, heap, pointers, etc... all function and come together. This video is so great because it relates everything together while showing what syntax does what so viewers will actually be able to see how their code works at a fundamental level. This is an amazing video and I will make sure to show it to anyone who wants to learn C or C++ (I know they are different languages in that they aren't both OOP and have some different syntax but the parts about pointers, the heap, and the stack should be conceptually similar).
Glad you enjoyed!
I've been developing with C# and such for quite a while now and I've never understood the use of pointers. But this video made so much sense of it in such a simple, short way! Great video👌
I'm glad to hear it!
I am learning c++ and this video was really really helpful in explaining some of the key concepts I couldn't find any explanation for anywhere.....
Thany you. Love your work.....
You're welcome, glad you found it useful!
Amazing video, I appreciate this so much. I'm starting college in about a month and I'm skipping straight to the second CS class because of AP credit I got during high school. the issue is that my high school classes all worked with java, while my college is gonna work with c++. so basically this is helping me a ton. Great job on this video and thanks so much
An absolutely awesome video! Coming from Java, C#, and C, you have answered so many tedious questions that come up that are often overlooked or left to the person to figure out for themselves. Honestly, universities should pickup this style of teaching as it's the most effective 39 minutes and 46 seconds of my life.
Thanks a lot! Are there any other topics you'd like me to make a video on?
@@ABCo-ABMedia I apologize for the late reply! I didn't receive a notification from RUclips and just saw this.
Personally, I would love to see a video (or a series) that discusses various types of language compilers and/or interpreters for select languages. For example, LLVM and Clang for C and C++, Java AOT compilers, JIT vs AOT, and etc.
Another potential topic could be automation through scripting. An example would be creating simple utility scripts on a particular OS to manage sorting of files given select parameters, a file-janitor that relocates the least used files in a particular directory to an "unused folder", periodic folder compression manager, and more.
This is so freaking awesome! Finally this made sense to me. Seriously hope there are more videos on your channel like this. Thank you VERY much for the awesome video! :)
Thanks! Glad you found it helpful!
What a gem, Thanks man, you explained it crystal clear!
This was surprisingly helpful and well explained!
Thanks!
So concise, love it! Question: at ~14:40 shouldn’t the call to SecondMethod be changed to “SecondMethod(&a)” so that the address of MyClass is sent as the parameter-or since the parameter specifies that it requires a pointer, can it grab the pointer automatically?
Assuming you mean "MyMethod(&a)`, you'll notice I do make that change after a second, I just don't comment on it!
I took C in college... Never touched C++. I struggled a bit to understand it, but was also completely new to programming.
Years later I taught myself C# and ended up finding C++ too intimidating. This video is incredibly well done.. as all the elements of C++ I couldn't understand.. are explained beautifully here.
It also shows me, as someone who wrote a fair bit of complex C code (obnoxious data structures exams/projects), how C++ (probably) grew over time. The 'malloc -> new' bit as one example.
Super interesting and now youve got me considering picking up C++ :p
I'm glad to hear you found the video helpful and it inspired you to play with C++!
Picking up C++ is definitely a nice way to expand your knowledge out further.
And in fact, when I got into it ages ago, it didn't just make me better at C++, it made me better at C# too, because as I learnt about the stack vs heap and about fully using pointers etc. It all started to fill in many of the gaps I had in my knowledge about how memory is actually structured in C# too. Like the difference between class and struct.
And it's what allowed me to then really get into the .NET internals, to the point where I can now safely say I know a lot now about the .NET internals and what's going on inside, and I'm definitely going to be making videos in the future about exactly that at some point! So stick around if you're interested in digging into what's going on inside C# and .NET, and such because videos about it will be coming at some point.
In the meantime though, the current thing going on in the channel is the "PowerShell" video series, PowerShell is something I think is really interesting because it's literally C# in a command line form, it's built on .NET and commands give back .NET classes and such.
By the way: If there's anything you'd specifically like to hear about the internals of, let me know and I'll happily prioritize it when the channel gets around to .NET internals
Covered a lot of good stuff. Thanks.
Thanks a lot! Tell me if there are any other topics you want me to cover!
Thank you so much! You explained it crystal clear
Glad to hear it!
Well, this is just perfect. Flawless presentation. Thank you very much.
Glad you liked it!
This was the best C++ video I've ever seen.
Awesome, thanks! :)
It's fucking rare the first result I watch is exactly what I wanted and more. Spectacular effort nicely packaged, thanks!
Nice!! Glad to hear it was everything you could have wanted :) I got more "advanced" videos like this coming soon!
When I first looked at C++ there were a lot of things confusing me but now it all makes so much sense, this is a very good summary. I will ofc have to do further learning but this video is a great start for anyone coming from C#
The same thing happened to me too when I first looked at C++, and I felt there just weren't any good resources that just simply _explained_ these core concepts for an already existing C# developer well, and that's why I made this video!
Can add that anyone coming from an interpreted language would benefit! Your video makes it clear what top-down implies in the structure of C++ verses an interpreted language.
Great video, imo it had the optimal length and covered all important topics. Maybe you could‘ve mentioned smart pointers when talking about memory allocation and freeing, as these are such an important tool in memory management.
Thanks for the feedback! I wanted to keep this video to just the basic differences and didn't want to pack too much content into it.
If you search for videos about plain pointers, then almost all of them are targetted at beginners, and the explanations are slow and in-depth like that, and I wanted to avoid that for people who already know C# with this video.
However, there is a lot more content on _smart_ _pointers_ and such for developers who are already experienced, so I felt like putting more advanced things like that in here wasn't necessary when there's already lots of correctly levelled content.
I might make some more videos on C++ in the future, however, so if there are any topics you do want me to cover, then be sure to let me know!
Excellent presentation. Thank you very much!
Fantastic video. Coming from C# and this made the basics easy. I do suggest putting time stamps into the video though for quick reference.
Thanks, and yeah I'll consider that. But part of the problem with doing that is a lot of the topics _depend_ on the topic from before so it makes people more prone to not understanding stuff.
I was looking for someone else’s video but ended up watching the whole thing. Awesome
Cool! Thanks for sticking with the video.
really good vid coming from JavaScript / C#, I was able to watch at 1.5x speed and still follow.
Happy to hear it!
It's worth remembering that arrays in C/C++ are literally just syntactic sugar for pointers - you can (though you probably shouldn't) put negative numbers into your square brackets to look at earlier entries in memory. If you're passing around an array, it's generally a good idea to pass the size of the array as well. This is why if you want to handle command line arguments, main needs to take a char** (basically an array of char arrays) as well as an int which lists how many char arrays are in the main array (usually named argv and argc respectively). There is no runtime bounds checking unless you add it. A C++ vector, on the other hand, while it doesn't have built in bounds checking, does at least store its own size, as well as having a number of useful methods. In most situations in C++, you should probably use a vector rather than an array, and a C++ string over a char array.
I... Already said that arrays are just pointers? And I already mentioned std:: vector... And std::string... So, what exactly are you getting at here that's new? :P
@@ABCo-ABMedia I just wanted to expand on that - the lack of built in bounds checking is a common cause of security issues in C++ code.
Also, it means that in code where you don't necessarily know the length of the array (if you're writing a library, for instance), you need to have both the array and its length as separate parameters to a function (or members of a class) because there's no built in way to get that information.
@@Parker8752 Fair enough
This is the literally the best proof that the RUclips Algorithm is dumb and blamable. I got to see this video now!. I wonder where are those other jewels hidden because of the RUclips ineptitude.
I never say this, but man your way of explanation is awesome and this video deserves more views and likes.
Haha glad to hear you liked it. And yeah I mean, in all fairness to RUclips, I don't upload enough (yet!) to compete with the larger channels that focus more on quantity over quality. But I'll be picking this channel up soon and hopefully it'll start getting even more recommendations!
I don't mind too much though, as long as it reaches enough people to make a difference I'm happy!
@@ABCo-ABMedia Cool.
This brilliant. It feels all intuitive.
You're really a GOAT for this video, my man. Thanks!
Haha alright, thanks! If you've got any topics (C/C++/C#) you would like me to cover, feel free to ask!
Incredible video! Thank you! You explain very well, you just earned yourself a new subscriber! :)
I'm glad you liked it!
Great video, one of the better videos for developers learning C++.
I have a question though.
What is the practical application for not using a pointer in a method signature? Like why would you not want to pass the pointer?
Well some types like "int" are so small that there's no point in passing them as a pointer, and you're actually just adding extra work for the CPU by doing it. And sometimes you might have types that are only 8-16 bytes, same situation. It's not too common to not pass a pointer but it definitely _can happen_ - it's why C# and Java opted for leaving which is used up to the _type_ itself and having most types being reference types (i.e. passed by a pointer)
I like the audio signal processing you used. And thank you for the excellent explanations in these subjects.
I'm glad you were able to find some enjoyment from the echo. I've pulled it back in all future videos however!
Super useful video, thanks a lot. I'll be subbing!
underrated video, you are awesome bro
Great Video. Thank you for sharing your knowledge. This helped me out a ton.
Happy to hear it!
This is gold. Thank you!
The fake echo is rather offputting but other than that, this was an amazing video to watch. You've covered a lot of topics in this video!
Thanks a lot! I know, it is a really big shame about the echo, it wasn't intentional. It was a problem with my gear, but I fixed it for all of my other videos.
Really Useful Video! i feel quite confortable in C#, but am keen to add C++ to my skillset for some personal projects, this helped lots!
Follow up video would be good with other tips and tricks!
Glad it was helpful. There isn't absolutely loads else to cover in a follow-up video, except templates. I'd recommend taking a look at "The Cherno" to learn more about C++, those videos are really good!
Just what I was looking for. Great presentation!
Thanks! Glad you liked it.
Subscribed within 5 minutes. Good stuff.
How did you manage to get a yellow rectangle around the line you are debugging?
in current version of Visual Studio 2022 this only exists in c#
In c++ there is only an arrow a rectangle does not appear.
Well... Given this video was made in 2020, I obviously wasn't using VS 2022 - I guess VS 2019 had it and they got rid of it (probably found it had some inaccuracies in some multi-line edge cases or something and decided it was best to get rid of it to avoid confusion)
Me: what is see and and?
*40 minutes later*
Me: I am now a C++ dev.
Haha well, glad to hear it made you feel that way! :P
Amazing summary, thank you for doing this video :)
Thanks, glad you liked it!
I have worked with C++ for years but 10years ago or so I started doing D. I would say that it would be easier to go to D than C++ and it is compatible with C and C++.
D or the subset of D (BetterC) is as fast C and C++ buts it is just much easier to read and maintain.
Fair enough! There are tons of languages that you could argue are better than C++, C++ is definitely a very flawed language! Still from an understanding perspective I think it's incredibly useful to know about, it definitely gives you a very unique perspective!
Can someone explain why in 15:00 there is a `&` to pass the address of the class but it is not like this in 25:00 ?
It's... Actually a mistake! I know, it sucks, it's awesome that you spotted it though!
thank you for asking the question! I got confused too
watching 7 minutes already breaking out laughing. c++ is great!
Huh, interesting reaction, what's the funny part? :P
@@ABCo-ABMedia Most of it. Particularly the part where you need separate header files or how you can't pass object around but have to deal with the pointer bullshit.
Just lmao. I'm going to use matlab to generate my cpp scripts I guess.
🤣🤣🤣
@@azgan123 Yeah the header files suck quite a bit, although it makes sense why they're necessary in terms of linkers, I think it could have *definitely* been designed a lot better.
But regarding the pointers, that's just how the CPU works! When you pass an object in C#, if that object is a "reference type" (like most things in C# are), it's passing a pointer, and at least in C++ you have control over whether it does that or not, whereas in C# you're forced to it always passing by reference. C++ is very good at exposing the behaviour of the machine which can be really useful for performance, which is C++'s main focus nowadays.
That being said, a lot of the performance things you can do in C++ you can do in C#, as C# has value types if you want that more fine-grained control over where things are in memory, it has optional pointers and many Unsafe APIs, it lets you allocate arrays to the stack using "stackalloc" and various other things that let you achieve almost anything you want to achieve in C++ in C#. So I personally prefer C# greatly as it lets you get very close performance to C++ if you need it.
Excellent video! Just wanted to correct a small mistake at 25:15 Mark. It should be secondMethod(&a). Let me know if I am mistaken. Thanks again for the great video!
Yeah, you're right. That was a mistake! Glad you still found the video helpful.
@@ABCo-ABMedia Definitely dude. The fact that I was able to notice and correct the mistake shows that your video is both very good at teaching the stuff and keeping the viewer engaged. Kudos for the stack visualization part, made it much more clear for me than ever before. Good luck.
This was soo helpful, thank you :)
please do a tutorial on assembly language and the stack!
If I can ever get around to it, I would definitely love to!
@@ABCo-ABMedia this was very useful regardless, appreciate it!
This is excellent. Thanks!
You're welcome
The video is really impressive! also the echo makes you sound like a god lol
Yeah the echo is the #1 problem I have with this video, glad you were able to look past it
This is so great. Thank you very much 💓++
Brilliant, thank you.
Thank _you_ for watching!
I don't understand the echo you have but this is great stuff
Im a lazy Java programmer with a C++ exam due in 2 hours which i learned nothing for (its all quite basic). We’ll see in a couple hours, but im pretty sure u just saved my exam lol. Some of these i would never have just guessed
Oh wow well, I... Hope it goes well! This wasn't really designed for an _exam_ in mind so the pressure is on there! lol
I am not on this level yet but I would look at it again in 2 months.
Yeah, you do need to actually know C# quite well before watching this video. Take as much time as you want, there's no rush.
That was on point!
Thanks!
Glad you liked it!
I understand all pictures loud and clear. But what language you are speaking?
Hi! I think there's kind of two aspects to what you just said, and I'll try my best to respond to both of them. In this video, there is a really, _really_ annoying echo - it's unprofessional, you have to get used to it at first, it turns people off the video when they first click on it, it _pains me_ knowing it's there, I really wish it wasn't... But there was nothing I could do once I recorded. I fixed the issue for future videos but the damage to this one was already done, so I just went on with it. You get used to it really quickly, but I agree, it _sucks_ - it pains me more than it pains anyone else, I can tell you that. That aspect... Yeah, I take 100% blame for.
Of course, I know that's not what you were talking about, you were talking about my pronunciation of words and my voice. Now look, I won't try and argue I have a particularly good speaking voice, or that I used to pronounce "s"es right, or that 2 years ago isn't representative now. But even if you were struggling to follow along, which if you saw all the visuals you can't have been, the good news is my videos all have subtitles on them! Turn 'em on, hell, mute the sound if you really insist, and enjoy! I do, and always have done, everything I reasonably can to try and offer the best experience, so if it makes you more comfortable, I encourage you to use that instead.
I'm happy that you enjoyed the visuals, and I hope the video helped you out in some way. I do appreciate the feedback, although you didn't mean it the way I'm treating it, but I assume the best.
Best wishes,
Alex
This video is actually fucking cool man. Love it!
Glad you like it! Sorry for the late reply, RUclips didn't show this comment for a while haha. If there are any topics you also want me to look at, then please tell me!
wow what a nerd. This video is actually golden! Thank you very much.
Uh, thanks? lol
Amazing.
To be honest I almost closed video when i heard boyish voice.
But I glad now that I didn't.
It's just amazing
Wow, uh, thanks? Not sure what to do about the "boyish voice"! :)
Glad it was helpful though
PS: If you had a problem with the echo, that's sorted out.
@@ABCo-ABMedia Sorry for that remark.
Can you make a video "java for c# developers" ? There isn't that much to cover, but it would be great to have such video, because i really couldn't find one on youtube...
@@qwertyls8552 Sure! I'll get to work on that as soon as I can! As for the remark, it's fine, I am pretty young lol
Now do C# for C++ developers :)
Haha. Someone else mentioned this in other comment funnily enough. In a sense, the video does help a bit, if it goes one-way it will naturally go the other way in some sense. But yeah there's stuff the video doesn't talk about because they're just not in C++. Best way to learn in that direction is to just get hands-on with C# and you'll get used to using it. Install Visual Studio, make a ".NET" project (not .NET Framework, just .NET) and essentially off you go.
Also I'm always around on the Discord server (or these comments I suppose) if you have any questions about differences you encounter as you use C#
it was very helpful, thanks alot
Very well done video, thanks
Glad you liked it! Be sure to tell me if there are any other topics you want me to cover! :)
This is amazingly good and on point.
I'm glad you like it!
Thank you!
awesome guy ....
Uh, thanks!
This was good stuff .
very useful thank you
30 seconds in, and as an audio engineer I gotta say that reverb is waaaay too Wet Bro lol but anyways seems like a good video, gonna continue watching..
Just finished up, great video, Thanks Bro 👍
It's mostly delay but yeah there is way too much of it, I know, and it was not intentional I assure you! You'll see me mention it in a bunch of other comments, sadly just something I couldn't do anything about at the time.
very very good video
Thanks!
Cpp is fucking hard man.
Thank man.
Great video, thanks !
Thanks!
Great video but the echo nearly killed me.
Yeah, I know, that's been fixed for future videos! Sorry about that!
@@ABCo-ABMedia It's okay, thanks for your content :)
24:52 I think you need to be passing in a pointer to the MyClass variable "a". Rather than passing in the whole class still.
Yep, that's a mistake!
@@ABCo-ABMedia Well you're video is clearly very informative if I'm able to spot mistakes by 25 mins in, with no prior experience. Thank you for the video!
Is your discord still active? I can't load the page on your website.
@@morganmulholland6654 Ah that would be because the link in the description is out-of-date, I should've updated it but being a 2 year old video, must have missed it - I updated it, and yeah, the Discord still exists and of course I still pay attention to anything that happens on it _but_ it's definitely not what I'd call "active", I haven't given that Discord any real attention in ages I'm afraid. I've just been spending on my time in other places like the C# channel of The Coding Den
Great video, thank you!
Thanks, happy to hear it.
You sound nerdy therefore i am sure i am in good hands considering programing
very nice video, thanks
Happy to hear it :)
amazing!