When the professors or TAs (teaching assistants) actually speak english (not a given) they don't actually teach instead they are culling. You only pass if you can teach yourself from over-priced and badly written textbooks or already know the material. To say I am disenchanted with US higher education is a broad understatement.
_EDIT: I'm letting the old example rot at the end, as it caused a lot of confusion. You'll eventually see even this example is wrong, but it better illustrates my thought process at the time._ If "else if" is just a nested if into an else, then this block of code should compile, but it doesn't: #include using namespace std; //Sorry guys I couldn't resist int main() { int x = 7; if (x == 7) cout
@@comradepeter87 Not sure if I am completely understanding what you're saying but the reason that code does not compile is because you cannot have a stand alone else. If...else come in pairs and else are linked to the closest incomplete if. Your first else is paired with if and the second else is not paired with anything. That is why the program doesn't compile.
I kinda understand what you say... Let me try to explain , I may be wrong... Plzz feel free to correct me...ill just wright the code part ,......,............. If(x==3) cout
cronnostiger64 personally, I think that assembly is extremely useful, especially when it comes to optimization. If you look at the source of any major game engine they all have parts written in assembly.
***** No problem! Check out the source for the idtech3 engine (doom3 engine) sometime it's all on github and really shows off the full power of c++ :) it's one of my favorite piece's of source to read through!
***** Absolutely! I would however recommend reading through the Idmath library in the project in that case :). I understand computer graphics somewhat, I still struggle with the API's however lol(opengl and vulkan), as for learning it, I'd recommend the tutorials offered by the cherno, thinmatrix(even though he uses java, the GL is the same) also recommend checking out the computer graphics series by computerphile(they give an awesome explanation of things like how matrices work, how the scene is rasterized and how the depth buffer is created!). And overall reading through blogs is also extremely useful, just remember to start with the fundamentals and work your way up!
I think an assembly tutorial/video would be a great idea. It really shows how the code write will end up working down at the metal. And gives new people a look into just how much the compiler can optimize your code without you realizing
You cover a lot of basic things I'm already thoroughly familiar with, but you do it in such a clear progression of explanation. You also still have some things that are new to me, like the dissassembly view. May not be what I personally need, but very well done.
was gonna watch it in 2x because I knew conditions, but couldn't after you started to talk about disassembly, your videos really informative and helpful.
I'm a computer science student and I am trying to learn C++ not for academical purposes but just a fun. I watched so many computer science videos on RUclips. Every channel I watched just explain "How does it used?". It was not satisfied. My friend suggested to me watch you and now hopefully, I listened him. I'm glad to meet your channel.
Please, a video for a brief explanation in assembly would be a good idea, not in great extent, just enough to follow debugging. Also, I think you should start the OpenGL series in parallel looking forward to that! Great series, we appreciate the fact that you go deeper in some points, it gives us a better understanding. Keep up the great work!
for the ones who were confused at 12:10, JE will jump if result of test instruction is EQUAL to 0, and test is bitwise AND, so if comparisonResult is 0, then the test of 0 and 0 will be 0 and we will skip printing "Hello", but if comparisonResult is 1, then the test of 1 and 1 will be 1 and so we will not jump because 1 is not equal to 0
I love your vids not only because every time I've learned so many new tricks within the old boundary of my knowledge; but also, I was able to understand the principle and the reasoning behind it. Those vids do make everything look so transparent, and do enhance my thought to view the codes in a much grander perspective. It feels like the difference between solving a physics problem using mere equations from the book (seek-and-match progress) and solving this problem by your understanding of its mathematical principle (deriving your own equations). GROUNDBREAKING lessons! I will spent the rest of two days finishing every single vid from this watch list!
Finally someone who teaches cpp in a proper & in a way that is easy to understand ! Our Professor also was trying to tech real cpp, the problem was that he doesnt understand how hard this things are if you just start to learn cpp, probably cause he's doing it for so long. Ty you saved me some cp :)
Great video again. Really interesting as well, and you explain the 'ins and out' of things as well, instead of just typing code and us copying it with no real understanding, which a lot of other people just do. Thanks for putting in the time to make these videos and series.
@The Cherno Your C++ series is absolutely amazing. Please, please do make a series on Assembly as well! Thank you for your great explanations. As someone with some previous experience, I still learn new things in almost every one of your videos in this series.
@Cherno Best C++ Teacher! I have been looking around for 2 Years. You are the REAL TheNewBoston! And please... YES, do something on Assembly. Would love so much. Thanks for everything Cherno.
Thank you! You are light years ahead of all other tutorials on RUclips because you take time to explain. Most others just type fast and say, don’t worry about what I’m doing, just do it. You are the best.
Hi Cherno, this series is well bought up, thank you for detailed explainations, mistakes and corrections, some new pts. and explaining via registors too. This was super fun and I hope you keep making new such videos. Thanks...😊😊😊😊
Please assembly tutorial! Your explanation is so clear and detailed! I had learned so much from you everytime despite my school had teach the topic before.
Great in depth view of a very basic concept. You have talked about optimization and one thing that I really felt missed in this video was lazy evaluation.
wait, how can you can you pointer of char arrays? at 19:20? Wouldn't that just compare the address of the char arrays and only works by chance due to a lucky compiler optimization?
something interesting: if you define two integer variables: a and b and then initialize it with 0 and 1 now here is a if: if(a&&b++){ ; } and after the if, the b is still 1 but if we change the condition: if(a||b++){ ; } this time b == 2 when I encountered this, I was amazed that the PC was not as stupid as I once had thought. It is clear about the condition structure. If there is a && structure, judge will end immediately after finding a false proposition(im a beginner, maybe there are some misunderstandings)
You can replace logical programming by doing mathematical operations instead? Wow, I am really intrigued in what you meant by that... I hope there'll be such example in later lessons.
ive learned sm from this series!! u r truly a life saver as ive been trying to learn c++ for some time but never rlly got anywhere. with this series it rlly helped me understand c++ and how it works.
19:40 Can someone explain why did comparison ptr == "Hello" return true if as far as I remember it compares the address that ptr contains and the address of the temporary object and it must never be true
Please note that the `ptr == "Hello"` works not because of the result of a string comparison but because the compiler reused the identical "Hello" c-strings (instead of creating two separate ones) and compared memory addresses (so clearly a c-string's memory address is equal to its own memory address, hence the comparison results in "true"). For string value comparison, use strcmp (for c-strings) or use C++ strings (std::string).
If you could do a series on assembly(IA-32), that would be amazing! Started software engineering not too long ago and this series is of tremendous help. Keep it up :D
If else if is not a keyword, how are we able to place an else at the end of the control block? Was just curious. But this tutorial is by far the best I have seen so far
19:39 is really confusing without explanation, because one would not expect ptr and the string literal "Hello" to refer to the same memory, unless they happened to have heard this before.
I've have a little knowledge about assembly and machine code, but it still seems quite foreign to me. I'd not be dissapointed to see one or more tutorials dedicated to assembly.
The best video tutorials. c++ i ever watch very detailed and easy to understand . 👍👍 specially in game engine programming. Can you make a tutorial about UI ingame programming in c++ visualstudio and its function like skills and invetory system with xml and external UI Dds file, client to server. 😃😆
So if I understand, if you can convert an if statement into a mathematical operation to make it faster you should do do? Won't the compiler in release mode with optimizations on do it for you? Because of the unintuitive way to write it it might be harder to understand when debugging or when looking at the code at some point later in time. Also, how long do you estimate it to be until you move on to actual programming of useful applications/games?
Conditional branching in the logic is the issue, not that it is an if statement specifically. The cpu (a single core) can work on several parts of the code concurrently (it has separate sub-units for comparisons, adders, float multipliers, register moves, prefetching lines of memory or cache, etc) If there is a conditional branch it won't know which way it should work ahead. Very modern machines (that do not run on a battery) use branch predictors that will work ahead based on the odds of the conditional, this can speed up long running programs but on individual conditions if it predicts the wrong branch all the working ahead is useless. (and the extra unused processing is wasted electricity)
6 years later and this is still the highest quality c++ tutorial on the internet, thanks!
ikr
you haven't seen this channel called code beauty
@@rowansteve-ng3fs Isn't she the one who does them like 10+ hour vids?
true
@@rowansteve-ng3fs wym "you haven't seen"?
I'm in college and you explain this stuff a lot better than my professors. Thank you so much for this. Keep it up!
When the professors or TAs (teaching assistants) actually speak english (not a given) they don't actually teach instead they are culling. You only pass if you can teach yourself from over-priced and badly written textbooks or already know the material. To say I am disenchanted with US higher education is a broad understatement.
This is why you don't go college if you want to do software engineering.
@@klarnorbert you can do both
why would anyone attend university?
@@spattermann5809 It's not just the US
"else if is just an if nested into an else"
my life is a lie
_EDIT: I'm letting the old example rot at the end, as it caused a lot of confusion. You'll eventually see even this example is wrong, but it better illustrates my thought process at the time._
If "else if" is just a nested if into an else, then this block of code should compile, but it doesn't:
#include
using namespace std; //Sorry guys I couldn't resist
int main() {
int x = 7;
if (x == 7) cout
@@comradepeter87 Not sure if I am completely understanding what you're saying but the reason that code does not compile is because you cannot have a stand alone else. If...else come in pairs and else are linked to the closest incomplete if. Your first else is paired with if and the second else is not paired with anything. That is why the program doesn't compile.
@@comradepeter87 else-if is a nested if into an else not else. That is, else is not a nested if into an else!
@@beesknees8296 You don't get it LOL!
I kinda understand what you say...
Let me try to explain , I may be wrong... Plzz feel free to correct me...ill just wright the code part
,......,.............
If(x==3) cout
Thanks! I'm learning so many new stuff from your videos.
"Compiler will do some magic... and you'll get rekt" XD
Best part :)
i thought it was 'get rekt' lol. Even youtube auto generated subtitles say it's get rekt.
@@martingaens2073 holy shit that's pretty funny. Im surprised the auto-generated subtitles use 'rekt'
@@joshuarowe8410 yeah, I guess it has to adapt to the meme culture
Fixed wrecked to rekt... nice
Please make some assembly tutorials!
why
Henrik Hey Do it!!
cronnostiger64 personally, I think that assembly is extremely useful, especially when it comes to optimization. If you look at the source of any major game engine they all have parts written in assembly.
***** No problem! Check out the source for the idtech3 engine (doom3 engine) sometime it's all on github and really shows off the full power of c++ :) it's one of my favorite piece's of source to read through!
***** Absolutely! I would however recommend reading through the Idmath library in the project in that case :). I understand computer graphics somewhat, I still struggle with the API's however lol(opengl and vulkan), as for learning it, I'd recommend the tutorials offered by the cherno, thinmatrix(even though he uses java, the GL is the same) also recommend checking out the computer graphics series by computerphile(they give an awesome explanation of things like how matrices work, how the scene is rasterized and how the depth buffer is created!). And overall reading through blogs is also extremely useful, just remember to start with the fundamentals and work your way up!
Good distinction of programming falling into two categories,
1. Mathematical programming
2. Logical programming
I think an assembly tutorial/video would be a great idea. It really shows how the code write will end up working down at the metal. And gives new people a look into just how much the compiler can optimize your code without you realizing
that "else if" part alone convinced me to watch the entire series
"The little bit extra" This is why I love this series
You cover a lot of basic things I'm already thoroughly familiar with, but you do it in such a clear progression of explanation.
You also still have some things that are new to me, like the dissassembly view.
May not be what I personally need, but very well done.
Please make videos on assembly! These are so cool.
was gonna watch it in 2x because I knew conditions, but couldn't after you started to talk about disassembly, your videos really informative and helpful.
I'm a computer science student and I am trying to learn C++ not for academical purposes but just a fun. I watched so many computer science videos on RUclips. Every channel I watched just explain "How does it used?". It was not satisfied. My friend suggested to me watch you and now hopefully, I listened him. I'm glad to meet your channel.
Yes, please an assembly tutorial!
That little else if tidbit at the end was really cool. Learned something today!
Please, a video for a brief explanation in assembly would be a good idea, not in great extent, just enough to follow debugging.
Also, I think you should start the OpenGL series in parallel looking forward to that!
Great series, we appreciate the fact that you go deeper in some points, it gives us a better understanding.
Keep up the great work!
I would love some assembly videos!!!! Great video anyways
do you code like this
{
}
or like this {
}
?
Fendoroid
In functions, 1st one
In if, while, etc. statements, 2nd one
Fendoroid Always the second one. I find it a lot clearer, although I can understand why people may find the first one clearer. Which one do you use?
Depends on the language convention
For example in js the convention is {
} but in c
{
}
{
}
Makes it easier to see which brackets make up a block together
Lewis B I used to put the open brace on a new line, but now I put it on the same line: it looks more compact.
20:58 "else" "hand gestures* " if"
have to love that explanation, nice video as always Cherno! :)
What I learned about C++ today: "anything really goes"
This is even better than Python!
I am glad I found this channel. Thank you very much.
for the ones who were confused at 12:10, JE will jump if result of test instruction is EQUAL to 0, and test is bitwise AND, so if comparisonResult is 0, then the test of 0 and 0 will be 0 and we will skip printing "Hello", but if comparisonResult is 1, then the test of 1 and 1 will be 1 and so we will not jump because 1 is not equal to 0
I love your vids not only because every time I've learned so many new tricks within the old boundary of my knowledge; but also, I was able to understand the principle and the reasoning behind it. Those vids do make everything look so transparent, and do enhance my thought to view the codes in a much grander perspective. It feels like the difference between solving a physics problem using mere equations from the book (seek-and-match progress) and solving this problem by your understanding of its mathematical principle (deriving your own equations). GROUNDBREAKING lessons! I will spent the rest of two days finishing every single vid from this watch list!
It's so fascinating how i can still learn stuff about these things, that i already used for years in your videos. Simply amazing
Finally someone who teaches cpp in a proper & in a way that is easy to understand ! Our Professor also was trying to tech real cpp, the problem was that he doesnt understand how hard this things are if you just start to learn cpp, probably cause he's doing it for so long. Ty you saved me some cp :)
So far this series is really intuitive and easy to learn from. Thank you Cherno!
Only someone whose mind would be blowned by finding out else if is not a keyword would be this enthusiasic about all these details.
Great video again. Really interesting as well, and you explain the 'ins and out' of things as well, instead of just typing code and us copying it with no real understanding, which a lot of other people just do. Thanks for putting in the time to make these videos and series.
The dissassembly part was brilliantly explained, first time I'm actually understanding this
This series is extremely helpful, thanks for the simple yet deep explanations. And yes, if you have time can you make an assembly tutorial?
Yes please an Assembly tutorial.
Wow. Interesting. I'm so in love with C++
@The Cherno Your C++ series is absolutely amazing. Please, please do make a series on Assembly as well!
Thank you for your great explanations. As someone with some previous experience, I still learn new things in almost every one of your videos in this series.
@Cherno
Best C++ Teacher!
I have been looking around for 2 Years.
You are the REAL TheNewBoston!
And please...
YES, do something on Assembly. Would love so much.
Thanks for everything Cherno.
You talk so much, and I love it. The depth of your explanations really helps explain why things work the way they do. Thanks!
Thank you! You are light years ahead of all other tutorials on RUclips because you take time to explain. Most others just type fast and say, don’t worry about what I’m doing, just do it. You are the best.
I don’t even understand assembly, but to see you step through the registers with the code beside it made so much sense!
this is a really UNDERRATED channel.
great! tutorial, in depth tutorial, on not only C++ but on computer programming in general; many thanks,
can't believe this cool playlist was created 6 years ago
thanks for explaining things from scratch. it is so valuable to see what actually is going under the hood of the c++. thanks a lot.
Hi Cherno, this series is well bought up, thank you for detailed explainations, mistakes and corrections, some new pts. and explaining via registors too. This was super fun and I hope you keep making new such videos. Thanks...😊😊😊😊
I loved the Disassembly part, well done Cherno!
Please assembly tutorial! Your explanation is so clear and detailed! I had learned so much from you everytime despite my school had teach the topic before.
Great in depth view of a very basic concept.
You have talked about optimization and one thing that I really felt missed in this video was lazy evaluation.
You deserve so many more subscribers/views. Thank you for your videos.
Please make a video with examples of logic vs mathematical program flow.
wait, how can you can you pointer of char arrays? at 19:20? Wouldn't that just compare the address of the char arrays and only works by chance due to a lucky compiler optimization?
Love this series so far. I like how you show things like viewing the disassembly and debugging in visual studio. 👍
yes. we want the assembly video pls. You are the best at teaching!
this integrated environment teaching helps us a lot!!!!! ✌️
I wish I had learned programming from the beginning the way you're teaching this.
Always learn new things from you (else if), never skip easy topics.
The way that you teach is very easy to understand. I am learning assembly, could you make a series video for that?
something interesting:
if you define two integer variables: a and b
and then initialize it with 0 and 1
now here is a if:
if(a&&b++){
;
}
and after the if, the b is still 1
but if we change the condition:
if(a||b++){
;
}
this time b == 2
when I encountered this, I was amazed that the PC was not as stupid as I once had thought. It is clear about the condition structure. If there is a && structure, judge will end immediately after finding a false proposition(im a beginner, maybe there are some misunderstandings)
I liked the videos so much that at this point I click the like button before actually watching the videos... :)
When I was using unity and C#, I figured out the else if thing on my own.
You can replace logical programming by doing mathematical operations instead? Wow, I am really intrigued in what you meant by that... I hope there'll be such example in later lessons.
Please do any Assembly tutorial some day please!! I've wanted to understand Assembly more for the longest time.
¡Te amo cherno! Sigo esperando tu video acerca de ensamblador.
Please make a video on assembly language. There are other video available but you explain things really well.
Thanks gret video my lazy college professor had me watch this to learn about if statements . The college should give you his paycheck.
you explain so well ❤❤❤
"branching makes your program slower"
*glances at yandere dev*
Thankyou so much for all your Cpp tutorials. I have learnt so much from you.
yes , we want some assembly tutorials
Much love, Yan! I really enjoy these vids, and appreciate the dedication you've shown.
Asm tutorials would be amazing
Hi Cherno! thanks for the video series.
yes please we want Assembly crash course
ive learned sm from this series!! u r truly a life saver as ive been trying to learn c++ for some time but never rlly got anywhere. with this series it rlly helped me understand c++ and how it works.
That is gold! Thank you.
Thx, my native lang is russian, but it's so easy to understand your speech.
19:40 Can someone explain why did comparison ptr == "Hello" return true if as far as I remember it compares the address that ptr contains and the address of the temporary object and it must never be true
exactly i was thining the same
You are amazing. Please make a course on x86-64 and arm assembly. I really love efficiency.
it pisses me off that after reading a 1200-page book your videos are not only more succint but more helpful than anything in it
YAAAY! Best time of the week :D
Please note that the `ptr == "Hello"` works not because of the result of a string comparison but because the compiler reused the identical "Hello" c-strings (instead of creating two separate ones) and compared memory addresses (so clearly a c-string's memory address is equal to its own memory address, hence the comparison results in "true"). For string value comparison, use strcmp (for c-strings) or use C++ strings (std::string).
can u explain a bit more
If you could do a series on assembly(IA-32), that would be amazing! Started software engineering not too long ago and this series is of tremendous help. Keep it up :D
If else if is not a keyword, how are we able to place an else at the end of the control block? Was just curious. But this tutorial is by far the best I have seen so far
glad i found this page
I really like this channel. Thanks Bro.
this is a masterpiece
The way that else if is really made blew my mind lmao
Else If is not a keyword... Mind blown :D
20:04
ENLIGHTENED!
I want to know more about mathematical vs. logical programming!
In computer science, logic is a subset of mathematics.
19:39 is really confusing without explanation, because one would not expect ptr and the string literal "Hello" to refer to the same memory, unless they happened to have heard this before.
else if blew my mind :)
Me at 2:37, jumping with happiness!!
thanx bruh!!
Assembly is a nightmare, but knowing assembly would be awesome
Excellent explanation..
We are still waiting for those assembly videos you promised 🙂
I've have a little knowledge about assembly and machine code, but it still seems quite foreign to me. I'd not be dissapointed to see one or more tutorials dedicated to assembly.
16:08 - If we write each and every part from if on a new line would the debugger move to every line and give us more details ?
The best video tutorials. c++ i ever watch very detailed and easy to understand . 👍👍 specially in game engine programming. Can you make a tutorial about UI ingame programming in c++ visualstudio and its function like skills and invetory system with xml and external UI Dds file, client to server. 😃😆
The Cherno is OP
*My takeaways:*
If statement is slow 2:10, what can we do 21:30
I would definitely be interested in Assembly videos
So good even after 5 years
So if I understand, if you can convert an if statement into a mathematical operation to make it faster you should do do? Won't the compiler in release mode with optimizations on do it for you?
Because of the unintuitive way to write it it might be harder to understand when debugging or when looking at the code at some point later in time.
Also, how long do you estimate it to be until you move on to actual programming of useful applications/games?
Conditional branching in the logic is the issue, not that it is an if statement specifically. The cpu (a single core) can work on several parts of the code concurrently (it has separate sub-units for comparisons, adders, float multipliers, register moves, prefetching lines of memory or cache, etc) If there is a conditional branch it won't know which way it should work ahead.
Very modern machines (that do not run on a battery) use branch predictors that will work ahead based on the odds of the conditional, this can speed up long running programs but on individual conditions if it predicts the wrong branch all the working ahead is useless. (and the extra unused processing is wasted electricity)