📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time.
Hi saldina, can you please share the code in your pinned comment as a github link or as a txt message it really helps before the evalution. Thank you for lessons.
I had a friend from Celic in Bosnia. You remind me of her. She is a teacher and you both have same personality. Maybe all Bosnian have same charming personality. Anyway your lessons on C++ are great for beginners.
Thank you very much Saldina. The handing of these exceptions is indeed very very VERY useful and I am truly happy that I have learned so much about this topic. Greetings from Brazil!!!!!!!!!
Hi Saldina, Thank you for spending your time creating video about C++. I'm not a CS student and not really good at programming but you help me pass C++ class. Now I also start to get interested to programming. I feel blessed that I found your channel, so please keep making videos like this:))
This channel is very perfect for learning C++ in an organic and simple way. she is teaching in very simple method spacially thanks, Mam for providing very helpful knowledge
Saldina I don't know how you get the time to do all these videos but thank you so much for all the help you have given me I am loving programming thanks to your channel. I think a great video you can do would be building a project like one that uses a user made form and a database etc. Any sort of real world application that one would be expected to make when in the field would be awesome!!!! Again thank you so much for your incredible help in sharing your knowledge. I once read a post from a wise person he said that knowledge becomes wealth if it is shared freely but it becomes a weapon when it is kept by selfish people. Thank you for spreading your riches and bettering humanity!!!
Hi Saldina, Thanks a lot for your effort in teaching C++. In this example, we can add one more print and demonstrate that fourth print will not get executed when third print got an exception.
Hey Saldina! I would really appreciate if you can make a detailed video on Operator Overloading including topics such as Fundamentals of Operator Overloading, Restrictions on Operators Overloading, Operator Functions as Class Members vs. as Friend Functions, Overloading Unary Operators, Overloading Binary Operators, Overloading of operators using friend functions. Thanks!
One of the important topics in C++, especially when using the STL as almost all of its functions will throw exceptions as soon as they encounter errors.
I summerize a point which may be easily overlooked: in 12:39 you must use "a pointer" as the parameter , so if you throw a "string type var" , you use the const char * ,because we need a pointer,however,"string" doesn't have pointer and "char" do.And string is actually a "char"
What I like about his videos is the pace and efficiency of what he explains. A discovery this channel!! It would be nice if you shared the code, although it is true that doing it by hand helps to understand it better.
unbelievable good, better than the book that divides a number by zero to get a throw, try, catch error. In the class chapter of the book, the example list class listing of a program and when it runs it goes "Woof, woof I am a two year old dog and I can wag my tail" and I think, "WHAT !!??, I could have written a program in BASIC to do the same thing."
if you like my teaching check my Practical Programming Course at www.codebeautyacademy.com We are building real desktop application in C# and you will be learning alongside other students, with me as your personal tutor. With this you will also gain access to exclusive Discord community. I'll be happy to have you there. :)
Thank you for your lessons, Saldina. You have clear English pronunciation, I like it. My English isn't so good, may be pre-intermediate level, but I understand you. Aside from programming I will study English listening with your lessons :) With love from Russia
Ciao Saldina, really good explanation about exceptions. I've also appreciated your slow speak, cause in this way every single words is recognizable and it's possible to totally absorb the meaning of the lesson.
Thank you for the video, I've learned exception handling already, but I always watch your videos in case I missed something when I first learned it, or you give a better explanation.
Very good concise introduction. Small point: there's a bug. Documents shorter than 10 characters will print without reducing the amount of available paper.
LOVEEE this video explaining everything I need in detail!! Also love the summary part, it goes through everything again and makes the concept more solid!! thank you so much!
You are a perfect detail in this world :D keep going, as a nonnative English speaker I found your speaking is very simple but at the same time understandable perfectly :D
I don't know whether you have already mentioned that in previous videos, but it would be worth to say, that integer division in C++ is always rounded down and because of that, in line where you calculate the required amount of paper, you should explicitly round the result up. BTW great video.
@codebeauty I really like your way of explaining programming, approaches and the language C++ itself. Unfortunately this video is showing how exceptions should not be used. Well, I've seen this a lot, so I think it's a general problem. Why? Well it's called "exception" not "error code". If your virtual printer is running out of paper it's not exceptional behavior but normal behavior. It can happen. So we should treat it that way. So returning an error code or better a structured error is the better implementation. This way the caller can also react in a proper, "normal" way. IMHO, here is what Exceptions are for. A type should raise an exception if its methods are called in a way so that they cannot work properly. Means the requirements of the methods parameters are not met. For your example, if a caller is trying to use the Print-method and the txtDoc parameter is null, line 14 would automatically raise an exception. Why is that? Well since txtDoc is not instantiated, the length method cannot be called. The minimal requirements of the Print-method are not fulfilled. Well of course there is already an implicit exception which is thrown, but it's cryptic and the caller needs to know your code to understand that calling .length is failing because he is passing null to your method. With an explicit exception, means " if (string.IsNullOrWhiteSpace(txtDoc)) throw new ArgumentNullException("Null is not allowed."); " this is not the case. Your API is much more robust and understandable. Plus your implementation can be seen as a blackbox which is always good. Anyway, keep up your good work. 👍
1) This might be an off topic but I almost immediately recognized your slavic english accent. 2) Also, If Im not mistaken, the "using namespace std" instead of "using std::string" and "using std::cout" might result either in increasing the executable's size or affect the coding proccess by adding an additional namespace of thousand names. Everything else is pretty much fine.
Hey Saldina , thank you so much for your videos, helps all the time🥺. Could you please also do a video on code smells in c++ ,like inappropriate intimacy, data class etc. and code refactoring
In my C / C++ classes as a student, I did a sort numbers into order using what I just leaned on "recursion function" without using a temp int., when it goes through the list and does not do a swap, it breaks out the calling itself cycle. Post school days maybe I could have tried classes to do, Ascending, Descending order, and maybe to really tax the brain, the same order of the telephone book (but with numbers not character string the book uses), that would in a order like 1, 10 150, 23 230, 3, ...............up to 9??? order. Then someone from a C / C++ email group said, try this out x^= y^= x^ = y^ = x ( ^ is exclusive or ) that does not need a temp int
23:57 my only query/worry is that this way becomes way too dependent on both the function call as well as function implementation. In my mind: 1. there should be some way within the function definition to try-throw-catch and jump back to caller function 2. If the caller function contains an assignment after return, then skip that assignment and proceed to next stmt This aint ideal though, as it wont work in other expressions like comparison, or cout etc...
One problem with most of your tutorials, including this one, is that you should also point out flaws in your example code. The biggest flaw and easiest to explain is that in your example code, you should be passing the strings as const references instead of passing them in by value which causes huge performance problems due to all the unneeded string copies. For example your ctor should have const string &name instead of just 'string name' (bad performance hit). Same with print. and since you aren't modifying the strings passed in, make them const. Doing this will help create less newbies running around creating bad code. There are many other improvements that would make your code better and production quality, but in a beginner tutorial that is not a good idea - but using references instead of by value when possible is something a newbie should learn day one.
That's exactly what I was thinking too. Passing a very large document by value will use up stack space so best pass a pointer or reference to the string document which is really passing an address to the document string. 👍
I subscribed your channel because you explain so many c++ functions that i have never learned in my study! Also its very easy for me to understand everything because your english is so fluent! :-) It would be interresting, if it's possible to put parameters into default catch functions instead of these "...". Thank you very much! Love from Germany!
Please if you haver make a course on data structures or files please teach how to create a dinamic array of structs in order to store all the components of the file. For example a leaderboard. If I dont want to create a big array of structs it might not be big enough to store all the players. If I make a big array of structs Im wasting precious memory. Also I would like to see videos of you teaching binary trees or graphs. Anyway, great channel, great content and an absolute great teacher. You go girl. Saldina to president
Yes @@tomastank1030 you are right, txtDoc.length() counts the length of the myPrinter.Print string in the main() function then it gets divided by 10 Maybe @doublej118jc should have changed divide by 10 to divide by 20
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
Hi saldina, can you please share the code in your pinned comment as a github link or as a txt message it really helps before the evalution. Thank you for lessons.
PLEASE never delete your channel/videos!!
Your content is so useful
I won't delete it. 😃 I'm hoping to reach even more people and help them learn programming. Thank you! 💜
Ah , I can't tell if your just simping or if this is meant to be sarcastic .
@@spencerignatescue158 the lonely virgin calling someone a simp. Smh
This channel is perfect for learning C++ in an organic and simple way.
I had a friend from Celic in Bosnia. You remind me of her. She is a teacher and you both have same personality. Maybe all Bosnian have same charming personality. Anyway your lessons on C++ are great for beginners.
Thank you very much Saldina. The handing of these exceptions is indeed very very VERY useful and I am truly happy that I have learned so much about this topic. Greetings from Brazil!!!!!!!!!
I love listening to you because you are explaining everything in the easiest possible way, but also you are speaking very clearly and have nice voice!
Hi Saldina, Thank you for spending your time creating video about C++. I'm not a CS student and not really good at programming but you help me pass C++ class. Now I also start to get interested to programming. I feel blessed that I found your channel, so please keep making videos like this:))
um what is a "CS" student ?
@@virtually2124 Computer Science Student
This channel is very perfect for learning C++ in an organic and simple way. she is teaching in very simple method
spacially thanks, Mam for providing very helpful knowledge
You have got amazing teaching skills.
You are the best than the teachers in university
That is so nice to hear! Thank you very much! 💜
Saldina is a great teacher ❤️
Thank you UMAIR AWAN! 💜💜
someone is in love with their teacher 🙊
this channel single-handedly carried me through my freshman computer engineering year, seriously thank you keep doing this you're great! (:
This tutorial is exceptional! :)
😁😁
@@CodeBeauty I love you
Saldina I don't know how you get the time to do all these videos but thank you so much for all the help you have given me I am loving programming thanks to your channel.
I think a great video you can do would be building a project like one that uses a user made form and a database etc. Any sort of real world application that one would be expected to make when in the field would be awesome!!!!
Again thank you so much for your incredible help in sharing your knowledge. I once read a post from a wise person he said that knowledge becomes wealth if it is shared freely but it becomes a weapon when it is kept by selfish people.
Thank you for spreading your riches and bettering humanity!!!
Big fan from india🇮🇳.
Ma'am your video help c++ language
a lot.
Thank you so so much.
Thanks for the support. Greetings to India! 🇮🇳🥰🥰
Hi Saldina, Thanks a lot for your effort in teaching C++. In this example, we can add one more print and demonstrate that fourth print will not get executed when third print got an exception.
Hey Saldina!
I would really appreciate if you can make a detailed video on Operator Overloading including topics such as Fundamentals of Operator Overloading, Restrictions on Operators Overloading, Operator Functions as
Class Members vs. as Friend Functions, Overloading Unary Operators, Overloading Binary Operators,
Overloading of operators using friend functions.
Thanks!
Your videos are so good that my professor takes your code and uses it for class lessons! Either that or you both code very similarly.
One of the important topics in C++, especially when using the STL as almost all of its functions will throw exceptions as soon as they encounter errors.
Indeed, it is very important topic! Thanks for your help with replying the comments in the chat today! 😃💜
I summerize a point which may be easily overlooked:
in 12:39 you must use "a pointer" as the parameter , so if you throw a "string type var" , you use the const char * ,because we need a pointer,however,"string" doesn't have pointer and "char" do.And string is actually a "char"
Seriously, this is the best programming channel on youtube. U r awesome!
it's my OOP exam in 2 days this video was absolutely helpul
I can't thank you enough, you have a great method of explaining.
What I like about his videos is the pace and efficiency of what he explains. A discovery this channel!!
It would be nice if you shared the code, although it is true that doing it by hand helps to understand it better.
yoh, you saved me when i needed you most. thank you for your easy to follow and understand videos
I Just couldn't grasp try catch blocks until this video thank you.
unbelievable good, better than the book that divides a number by zero to get a throw, try, catch error.
In the class chapter of the book, the example list class listing of a program and when it runs it goes "Woof, woof I am a two year old dog and I can wag my tail"
and I think, "WHAT !!??, I could have written a program in BASIC to do the same thing."
if you like my teaching check my Practical Programming Course at www.codebeautyacademy.com
We are building real desktop application in C# and you will be learning alongside other students, with me as your personal tutor. With this you will also gain access to exclusive Discord community.
I'll be happy to have you there. :)
This tutorial is very helpful for me. By many videos like this, I can learn not only coding but also English learning skill
hey seldena.. U have busy routine but still u spend time on us like making videos for us and share your knowledge with us and i think U r amazing 🙏💜
Thank you so much. the support that I get from this community means a lot to me! You're the best! 💜💜💜
it's Saldina*
My favorite youtube teacher for C++.
I like that your have tasks under video. So your make not just video it's very good content for learning.
Yep, I often include small tasks so that my viewers can use them to practice on their own as well. Thanks! 😃😃
Thank you for your lessons, Saldina. You have clear English pronunciation, I like it. My English isn't so good, may be pre-intermediate level, but I understand you. Aside from programming I will study English listening with your lessons :) With love from Russia
Awesome. Thank you
Never stop making videos, you are doing a great work!!
Ciao Saldina, really good explanation about exceptions. I've also appreciated your slow speak, cause in this way every single words is recognizable and it's possible to totally absorb the meaning of the lesson.
Thank you for the video, I've learned exception handling already, but I always watch your videos in case I missed something when I first learned it, or you give a better explanation.
Thank you for all the time that you teach us🙏❤️
C++ is beautiful when you understand it!
Thank you for all the time you give us!!!
Very good concise introduction. Small point: there's a bug. Documents shorter than 10 characters will print without reducing the amount of available paper.
You've explained exception quite clear.
Wonderful explanation of exceptions. You made it easy.
LOVEEE this video explaining everything I need in detail!!
Also love the summary part, it goes through everything again and makes the concept more solid!!
thank you so much!
Hii love from algeria❤️your teaching skills are awesome
Thanks and welcome! Greetings for Algeria! 💜
Good diction, very clearly explained. Perfect!
best programming channel i learned so much from u
I'm happy to hear that 🙏💙
Thank you sooo much. This try catch throw stuff is quite tricky if you first touch it!!,😅
you are so good at explaining, i love watching your videos and hopefully i will also pass the exam!!
Your teaching way is superb
You are a perfect detail in this world :D keep going, as a nonnative English speaker I found your speaking is very simple but at the same time understandable perfectly :D
thank you. Im begginer in cpp and its useful for me.🥰
saldina i salute your work you are so much hardworking
Most awaited!!!
Happy to hear that! ❤️
Advantages of using error handling methods over only using if-then statements?
Maybe for readability and you won't need to put a special return value for function in case you want to handle error.
What a fantastic explanation.!
Very good. I come from VietNam. I learn both English and C++
Amazing video you just helped me add exceptions to my final project thnx a lot
Awesome. this is what i have been looking for. implementation on the topic and clear explanation.
And don't forget about RAII as a finally block :)
Awesome video😎😎👍👍
You are a great teacher saldina
Subscriber++;
Thanks for this video, Nice explanation.
❤️ from India.
I don't know whether you have already mentioned that in previous videos, but it would be worth to say, that integer division in C++ is always rounded down and because of that, in line where you calculate the required amount of paper, you should explicitly round the result up. BTW great video.
This is only an example. This is not about printing but about Exception handling. Nobody cares about math here or should.
Great! Keep going code beauty! every interesting training.
You should've covere custom exceptions they are the interesting part
Hmmp for me you are one great teacher
So very clear and understable thanks😊
This vedio I really all the time which I want 🙏 thank mam
You are Such a Legend
please make C# videos
I am from India, mam ur awesome 🙌
@codebeauty I really like your way of explaining programming, approaches and the language C++ itself. Unfortunately this video is showing how exceptions should not be used. Well, I've seen this a lot, so I think it's a general problem. Why?
Well it's called "exception" not "error code". If your virtual printer is running out of paper it's not exceptional behavior but normal behavior. It can happen. So we should treat it that way. So returning an error code or better a structured error is the better implementation. This way the caller can also react in a proper, "normal" way.
IMHO, here is what Exceptions are for. A type should raise an exception if its methods are called in a way so that they cannot work properly. Means the requirements of the methods parameters are not met.
For your example, if a caller is trying to use the Print-method and the txtDoc parameter is null, line 14 would automatically raise an exception. Why is that? Well since txtDoc is not instantiated, the length method cannot be called. The minimal requirements of the Print-method are not fulfilled. Well of course there is already an implicit exception which is thrown, but it's cryptic and the caller needs to know your code to understand that calling .length is failing because he is passing null to your method. With an explicit exception, means " if (string.IsNullOrWhiteSpace(txtDoc)) throw new ArgumentNullException("Null is not allowed."); " this is not the case. Your API is much more robust and understandable. Plus your implementation can be seen as a blackbox which is always good.
Anyway, keep up your good work. 👍
I find your content so useful
Thanks a lot Saldina I am beginner in C++ I understand with more then my teacher i wrote all his exemples but when I compile gives errors
Can you make video on projects we should include in our resume as a fresher
Please make video on python I'm having a great time in learning c++ through your awesome video!.
But it's not a Python channel...
1) This might be an off topic but I almost immediately recognized your slavic english accent.
2) Also, If Im not mistaken, the "using namespace std" instead of "using std::string" and "using std::cout" might result either in increasing the executable's size or affect the coding proccess by adding an additional namespace of thousand names. Everything else is pretty much fine.
Pozdrav iz Srbije. Video je bez error-a. :D
Pozdrav za 🇷🇸
🤗❤️❤️
Thank you for your videos, I like them very much! very helpful!
Amazing teacher, thank you
Hey Saldina , thank you so much for your videos, helps all the time🥺. Could you please also do a video on code smells in c++ ,like inappropriate intimacy, data class etc. and code refactoring
Waiting!!!!!
😃💜
Hii love from India ❤️your teaching skills are awesome
Thanks for the support. Many greetings to India! 🇮🇳❤️❤️
i would love to learn coding,well appreciated Saldina.
In my C / C++ classes as a student, I did a sort numbers into order using what I just leaned on "recursion function" without using a temp int., when it goes through the list and does not do a swap, it breaks out the calling itself cycle.
Post school days maybe I could have tried classes to do, Ascending, Descending order, and maybe to really tax the brain, the same order of the telephone book (but with numbers not character string the book uses), that would in a order like 1, 10 150, 23 230, 3, ...............up to 9??? order.
Then someone from a C / C++ email group said, try this out x^= y^= x^ = y^ = x ( ^ is exclusive or ) that does not need a temp int
Much appreciation
this video is very useful👍
23:57 my only query/worry is that this way becomes way too dependent on both the function call as well as function implementation. In my mind:
1. there should be some way within the function definition to try-throw-catch and jump back to caller function
2. If the caller function contains an assignment after return, then skip that assignment and proceed to next stmt
This aint ideal though, as it wont work in other expressions like comparison, or cout etc...
cool explain about handling errors in c++
One problem with most of your tutorials, including this one, is that you should also point out flaws in your example code. The biggest flaw and easiest to explain is that in your example code, you should be passing the strings as const references instead of passing them in by value which causes huge performance problems due to all the unneeded string copies. For example your ctor should have const string &name instead of just 'string name' (bad performance hit). Same with print. and since you aren't modifying the strings passed in, make them const.
Doing this will help create less newbies running around creating bad code. There are many other improvements that would make your code better and production quality, but in a beginner tutorial that is not a good idea - but using references instead of by value when possible is something a newbie should learn day one.
That's exactly what I was thinking too. Passing a very large document by value will use up stack space so best pass a pointer or reference to the string document which is really passing an address to the document string. 👍
Super fantastic. Can you make a second video that shows how to throw and catch std::exception and std::runtime_error ?
a very very good video :) thank you
Thank You !! Kudos to your good work !
you really are amazing ma'am, keep up the great work, love from INDIA
🥰🥰
I subscribed your channel because you explain so many c++ functions that i have never learned in my study! Also its very easy for me to understand everything because your english is so fluent! :-)
It would be interresting, if it's possible to put parameters into default catch functions instead of these "...".
Thank you very much!
Love from Germany!
There is no need for parameters in default catch, because it will catch any unhanded exception 🤗🤗
regardless of its type 😃
Please if you haver make a course on data structures or files please teach how to create a dinamic array of structs in order to store all the components of the file. For example a leaderboard. If I dont want to create a big array of structs it might not be big enough to store all the players. If I make a big array of structs Im wasting precious memory.
Also I would like to see videos of you teaching binary trees or graphs.
Anyway, great channel, great content and an absolute great teacher. You go girl. Saldina to president
@18:22
I'm curious how you were able to comment out the code all at once. Is there a shortcut?
CTRL + K + C
exceptional!! :P
witty :P 😃💜
@@CodeBeauty Thanks :)
Thank you for the video, awaiting for next videos ♥️
Никогда бы не подумал, что С++ можно преподавать так просто :)
Great job with explanations.
🚀🥰
Good lesson! My code took 4 Print method calls though to throw the exception.
Depends how long your string is.
Yes @@tomastank1030 you are right, txtDoc.length() counts the length of the myPrinter.Print string in the main() function then it gets divided by 10
Maybe @doublej118jc should have changed divide by 10 to divide by 20
Could you please refer a open book pdf of c++ for better learning of programming