Note: The class schedule changed since the first lecture. I have combined both C++ lectures into a single video, and added some live-coding sessions as well. This video was originally live streamed in Fall 2022 and edited for inclusion in the Fall 2024 course. This video is meant as an introduction to the C++ programming language for people who already know another programming language like Java / JavaScript / Python.
I have worked as a C++ developer in the automotive industry for over five years. I finally decided to follow my passion and learn game development. I just came across your course, and I'm now sitting down and enjoying a review of all my C++ knowledge.
For those who were not in inperson class, professor mentioned in early UNIX systems, the default name for the output of an assembler or linker was a.out. The tradition carried forward even after compilers like GCC became more widely used.
2:41:40 Oh Dave I also feel the insufferable pain. The best tutorial I have seen so far. Very suitable for a person, that has an experience with programming already and just wants to learn/revise C++. :) Can't wait to make my first game!
You should do an episode on simple game networking, I love your explanations and especially your live coding session. I'd love to have a professor like you.
such a beautiful lecture !! i understood these consts and references and pointer's businesses so well ... i am very glad that i came through this course ! ❤
even if you are not new to C++ i absolutely recommend you watching this tutorial, it will give you some "Aaaaah so that's why......" moment that makes it extremely useful to watch.
1:30:00 If you are not seeing this warning it's probably because you have not told the compiler to do so. Simply add the flag -Wall when compiling to see this error. File reading example 2:00:20
I'm definitely not new to C++ and enjoy using it (can't say I'm the most proficient though!) but it's always great watching passionate and knowledgable educators at work. Your students are very lucky to have access to high quality teaching like this.
In the living coding around 3:35:00, when you initalized int a and int b and printed their addresses, the addresses changed everytime you ran the program, but they were still contiguous. Is that because when you initalize them, they are always allocated in order on the stack memory? For some reason, I always thought it would be a randomized address except if it's an array.
In my experience, stack variables which are allocated right next to each other in code are usually right next to each other in memory. But the C++ spec does not guarantee this. The reason their address is different every time the program is run is because the OS finds a different spot in memory to run the program.
Man was starting out the lecture with "C++ is not bad haha... Don't trust the memes... Pls" hoping his students were not scared, when all he had to do was show us the ferret right away. Subbed for George and his TA.
hello proffesor, i finished the lecture but i wanted to ask you if i need any prior knowllege before i continue, since you said ( you are 4rth year something you should understand this ) and how can i apply my understanding on this since i don't have accses to materials.
Setting up C++ compiler on Windows is a "god damn nightmare". I laughed at this!! Because, it is true just like trying to do software development in general on Windows. Dang, I love the package managers on Linux and Mac and the many other features we enjoy when developing on them. (not to mention terminal)
Use the community version of MS Visual Studio. It's super easy to set up. Just install it, and you're ready to go. It's more powerful than any IDE on Linux. I've been using VS for 28 years. Wouldn't touch anything else. Personally, I find Windows way easier to use than Linux. I hate the Linux terminal. There is too much reliance on the terminal in Linux. I also dislike the Linux way of installing software. And while I'm on the topic, I hate importing anything coded on Linux into Windows. Too many of the Linux open-source projects rely on CMake and other archaic approaches
This is a game programming course which involves some rudimentary physics code but nothing I'd call simulation worthy. Check out Coding Adventures on Sebastian Lague's channel
I agree that lack of expressivity in C++ is vastly overblown, but you can definitely write your student loading function in fewer lines of code in Python. For example: def loadFromFile(filename): with open(filename, 'r') as student_data: for line in student_data: first, last, student_id, avg = line.strip().split() addStudent(Student(first, last, student_id, avg)
I haven't finished the whole video. It would be better if you did not mention any other languages when explaining C++. As someone completely new to programming it makes me think I should be learning a different language first in order to learn this programming language. Which makes it hard for me to get past the beginning of this video. Like language speaking classes teachers/professors do not typically reference any other language, at least most of the teachers I've had. Or if they do it's short simple and usually only once.
Java source code is compiled into byte code, which is run on the JVM. Some JVM implementations interpret the code, some JIT it to machine code. So it's definitely always compiled, just not to machine code in all cases.
Note: The class schedule changed since the first lecture. I have combined both C++ lectures into a single video, and added some live-coding sessions as well. This video was originally live streamed in Fall 2022 and edited for inclusion in the Fall 2024 course.
This video is meant as an introduction to the C++ programming language for people who already know another programming language like Java / JavaScript / Python.
I have worked as a C++ developer in the automotive industry for over five years. I finally decided to follow my passion and learn game development. I just came across your course, and I'm now sitting down and enjoying a review of all my C++ knowledge.
BEST C ++ tutorial I've watched !
For those who were not in inperson class, professor mentioned in early UNIX systems, the default name for the output of an assembler or linker was a.out. The tradition carried forward even after compilers like GCC became more widely used.
2:41:40 Oh Dave I also feel the insufferable pain. The best tutorial I have seen so far. Very suitable for a person, that has an experience with programming already and just wants to learn/revise C++. :)
Can't wait to make my first game!
You should do an episode on simple game networking, I love your explanations and especially your live coding session. I'd love to have a professor like you.
@@taintedtaylor2586 I wish I could but I know almost nothing about networking!
@@DaveChurchill It’s ok, thank you so much for answering!
Thanks a lot for sharing all of this for free, really appreciated, amazing explanations aswell
Brilliant course. Even though I've been a C++ developer for 28 years, I learned a few things.
You are an excellent teacher 🙂
such a beautiful lecture !! i understood these consts and references and pointer's businesses so well ... i am very glad that i came through this course ! ❤
Thank you, Professor Dave 🎉🎉🎉🎉
If this is anything like your SFML lectures then it will be gold dust!
I love your teaching style and attitude. I hope we can have an absolute beginner C++ course as this is quite advanced to some of us.
even if you are not new to C++ i absolutely recommend you watching this tutorial, it will give you some "Aaaaah so that's why......" moment that makes it extremely useful to watch.
Long video but very much worthwhile.
1:30:00
If you are not seeing this warning it's probably because you have not told the compiler to do so. Simply add the flag -Wall when compiling to see this error.
File reading example
2:00:20
Very effective 4 hrs i spent.Thanks
Many Thanks, clear explanations 👍
I'm definitely not new to C++ and enjoy using it (can't say I'm the most proficient though!) but it's always great watching passionate and knowledgable educators at work. Your students are very lucky to have access to high quality teaching like this.
In the living coding around 3:35:00, when you initalized int a and int b and printed their addresses, the addresses changed everytime you ran the program, but they were still contiguous. Is that because when you initalize them, they are always allocated in order on the stack memory?
For some reason, I always thought it would be a randomized address except if it's an array.
In my experience, stack variables which are allocated right next to each other in code are usually right next to each other in memory. But the C++ spec does not guarantee this. The reason their address is different every time the program is run is because the OS finds a different spot in memory to run the program.
@DaveChurchill Thanks! I understood the random address, but was not expecting them to consistently be allocated next to each other. Thanks again.
Man was starting out the lecture with "C++ is not bad haha... Don't trust the memes... Pls" hoping his students were not scared, when all he had to do was show us the ferret right away. Subbed for George and his TA.
this guy is a total pro
You missed the opportunity to talk about how C++ code is the backbone of modern practical AI via PyTorch, TensorFlow and especially CUDA
Sir, you dropped this 👑
2:39:41 you meant to say the unary operator is the equal sign
I actually meant to say that the ampersand is the unary operator. Equal sign is binary operator
@@DaveChurchill Oh I see. I assumed equal because I havent seen the ampersand called an operator. Thanks for clearing that up.
hello proffesor, i finished the lecture but i wanted to ask you if i need any prior knowllege before i continue, since you said ( you are 4rth year something you should understand this ) and how can i apply my understanding on this since i don't have accses to materials.
Personal Timestamps
October 9 - 0:00 / 34:45 / 1:11:15.
jesse we have to program c++
can't cook with java
I love u 😭 i ve been watching ur videos and i just wanted u to know..
I lol'd when you said that C++ for windows is a nightmare. It really is.
for me the true gate to hell in C++ is called template metaprogramming.
Setting up C++ compiler on Windows is a "god damn nightmare". I laughed at this!! Because, it is true just like trying to do software development in general on Windows. Dang, I love the package managers on Linux and Mac and the many other features we enjoy when developing on them. (not to mention terminal)
Use the community version of MS Visual Studio. It's super easy to set up. Just install it, and you're ready to go. It's more powerful than any IDE on Linux. I've been using VS for 28 years. Wouldn't touch anything else.
Personally, I find Windows way easier to use than Linux. I hate the Linux terminal. There is too much reliance on the terminal in Linux. I also dislike the Linux way of installing software. And while I'm on the topic, I hate importing anything coded on Linux into Windows. Too many of the Linux open-source projects rely on CMake and other archaic approaches
I want to learn how to write simulation software (not just for games). Is COMP 4300 the best course for me or should I look for something else?
This is a game programming course which involves some rudimentary physics code but nothing I'd call simulation worthy. Check out Coding Adventures on Sebastian Lague's channel
how do make a vim macro like that? that's awesome
Nice. I also tackeled this on my channel.
getAvg function should return float type, not int.
I agree that lack of expressivity in C++ is vastly overblown, but you can definitely write your student loading function in fewer lines of code in Python. For example:
def loadFromFile(filename):
with open(filename, 'r') as student_data:
for line in student_data:
first, last, student_id, avg = line.strip().split()
addStudent(Student(first, last, student_id, avg)
The Hank Hill voice when that array printout listed all those garbage values
Aww George looks immaculate! I hope he lands a big job and makes a AAA game soon 😄
Unfortunately George passed away, but he is still an inspiration :)
@@DaveChurchill Rest in peace George 🙏
I am a truly curious being, I am dying to see how that macro is built in vim.
Could you make a 3D SfML videos
SFML is a 2D graphics library only
👍👍👍
Only C is worthy of applause!
I often use C++ a bit like C, but with all of the extra good stuff available.
Can't do that Dave!
Justice for George 😴 53:35
IAM learning cpp and have printed 1000 page book still watching this video
I haven't finished the whole video. It would be better if you did not mention any other languages when explaining C++. As someone completely new to programming it makes me think I should be learning a different language first in order to learn this programming language. Which makes it hard for me to get past the beginning of this video. Like language speaking classes teachers/professors do not typically reference any other language, at least most of the teachers I've had. Or if they do it's short simple and usually only once.
This is part of a 4th year computer science course in which students have used other languages but not necessarily C++
@@DaveChurchill oh ok that makes more sense now. thank you. sorry about my earlier comment.
G++ = George++
Java is neither a compiled language nor an interpreted language, but both.
it's almost like these terms are only applicable to programs, not programming languages
Java source code is compiled into byte code, which is run on the JVM. Some JVM implementations interpret the code, some JIT it to machine code. So it's definitely always compiled, just not to machine code in all cases.
It would be better not to use dark background for video.
Ah c++ you messy language. I guess I will give you another go.
There are many languages as messy, if not more so. I find java and js messy.
RAII - was invented by a Pirate :))
32:50 - you lost me with Allman style.
Never will accept that ugly style.
I also thought this way until I tried it for a significant amount of time.
@@DaveChurchill ehhh, not sure about that. Having 18 yrs. experience with Java, I became pretty strict with code style.
Allman is the best.
@@ElPikacupacabra never