C++ OOP - What is encapsulation in programming?

  Рет қаралды 139,395

CodeBeauty

CodeBeauty

4 жыл бұрын

Encapsulation is one of the most important characteristics of Object-Oriented Programming. Encapsulation helps in data hiding and is used to prevent direct access to data. In order to access that data, public methods are exposed, and the user can change and access private members of the class only by using those public methods.
📚 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.
Download Visual Assist here: bit.ly/WT-CB
I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
Download Ultra Edit here: bit.ly/UE_CB
It is a powerful, secure text editor designed specifically for programmers.
☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. You can use the link below to make a contribution: bit.ly/CodeBeauty_BuyMeACoffee
However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
Common question:
Why should we use encapsulation when it is much easier to access and change properties if we don't?
The answer is because we don't want to allow other developers to change and access everything they want, but we want to expose only properties that they should be able to see and change, and they can use them only if they obey the rules that we define. In that way, our data stays safe from outside misuse, because if you allow someone to have full permissions and do whatever he/she wants, it's just a matter of time when that person will wander off the intended way of building that system, create some complex overkill logic that is hard to understand, make things very dependent on one another, write duplicated code, etc.
So there are many benefits related to encapsulation: easier to maintain the code, hides the data, easier to test, reusable...
Let me give you one simple example of an application that can be used only by people that are 18+ years old. When the user registers, he enters his age, and there you have to check if his age is greater than 18.
If it is, he should be able to use the app, but if it is not, throw him an error.
Imagine also that the mentioned application has the option to edit user data. That means that the user can change his age after registration as well, so you would have to check again if age greater than 18 and behave accordingly, so writing the same code once more.
And then, if all of a sudden someone decides that the app will be for people who are 21+ only, you have two places where you need to make that change. (This is a simple example, changing 18 with 21 is easy, and having two places where you need to do that is easy, imagine having some complex logic that you need to change in 20 places)
What you can do instead is you can do the "age greater than 18" logic in the setter, and save the user's age if he is older than 18, and then write an error is he is not. That way each time that you want to set a value for the Age property, the same logic is executed, and each time that you have to change something, you do that in one place only.
C++ Object-Oriented Programming playlist:
• C++ OOP - Introduction... - Introduction to OOP
• C++ OOP (2020) - What ... - Constructors and class methods
C++ for beginners course: • C++ FOR BEGINNERS (202...
C++ functions course:
• C++ FUNCTIONS (2020) -...
Follow me on other platforms:
Instagram 📸 - / truecodebeauty
Twitter 🐦- / truecodebeauty
******Initial code is available on TrueCodeBeauty Git******
github.com/TrueCodeBeauty/Enc...

Пікірлер: 237
@CodeBeauty
@CodeBeauty 3 жыл бұрын
📚 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.
@mistersir3185
@mistersir3185 3 жыл бұрын
I love how you're all business. Your videos are straight to the point with no BS. Thank you for being here on KZbin.
@CodeBeauty
@CodeBeauty 3 жыл бұрын
🤗☺️🥰
@suyashmisra7406
@suyashmisra7406 3 жыл бұрын
i've tried to learn oop concepts from half a dozen sources . this is by far the most practical example i've seen . thank you,and keep up the good work!
@johnnyshinnichi1785
@johnnyshinnichi1785 Жыл бұрын
Same here. Very well explained.
@azadr
@azadr 3 жыл бұрын
Started with oop concepts, I got stucked & then these explanation on c++ oop help me a lot - thanks a lot 😊
@bolow
@bolow 2 жыл бұрын
Thanks for keeping it simple, please keep these videos coming.
@bryanwere8701
@bryanwere8701 3 жыл бұрын
from kenya i have never subscribed to any youtube chanell and this is the first one dear, Thanks alot, i have been looking for some one with good explanation like yours
@theKuntalPaul.
@theKuntalPaul. 3 жыл бұрын
I started watching the OOP playlist as a part of my preparation process with the constructor video and I must say your explanations are very precise and to the point. Instead of dumping out every piece of information, you walk us through the concepts with a possible realistic scenario. Hope to see more content from your side. ❤
@lhaellor
@lhaellor 2 жыл бұрын
She should actually be my tutor in the university rather than these boring tutors that work just for money and just want to finish work.
@kevin_mitchell
@kevin_mitchell 7 ай бұрын
Some tutorials from other sources make the program example they use very complex with hundreds of lines of code with advanced concepts unrelated to the topic they're explaining, making it extremely difficult to follow along with and code it themselves to see how it works. It seems like they are trying to impress other advanced programmers with their coding skills rather than educate their students.
@nirbhaykumarchaubey8777
@nirbhaykumarchaubey8777 4 ай бұрын
I too learnt constructors from her
@russelyg1803
@russelyg1803 2 жыл бұрын
Preparing for an exam tomorrow. 🥴 Crash course!! Really helpful, the playlist. Thanks for awesome Content!
@Progged
@Progged 10 ай бұрын
so inside the class under the public access modifier : void setName(string name) { Name = name; } string getName() { return Name; }
@imSky69
@imSky69 10 ай бұрын
this playlis is really helpfull to me , i wanted to thank you so much because of the effort that you made , keep shining up lady
@dukujohnkenyi6688
@dukujohnkenyi6688 2 жыл бұрын
hello Saldina this is John from freecode camp and i love the effort thanls for sharing
@SHIVAMSHUKLA-be7zj
@SHIVAMSHUKLA-be7zj 2 жыл бұрын
by far the best definition ... thank you
@tawansiforlifetfl9987
@tawansiforlifetfl9987 3 жыл бұрын
Thank you so much for your videos and your time. I have been studying OOP for this semester and I did not understand a word from my Professors. Your OOP Course on Free Code Camp Yt Channel has helped me a lot plus I am a subscriber to your channel and watched the Html and css playlist and C++ for beginners. You are a great tutor. PS Note: Try to keep your smile in every video because it is very nice.
@monoman4083
@monoman4083 3 жыл бұрын
Hope you get to 10k+ subs very, very soon.
@user-nx5hu8xe6d
@user-nx5hu8xe6d 4 ай бұрын
Your videos are awesome! Very helpful.
@sebgoesgaming2807
@sebgoesgaming2807 3 жыл бұрын
Thanks! I think it would be a good idea if you add chapter markers in the progress bar
@ahmadalr1990
@ahmadalr1990 5 ай бұрын
you're amazing in the way you guide us step by step,, thanks a lot Selina
@rameshwarprasad4722
@rameshwarprasad4722 4 жыл бұрын
Amazing,clear and to the point explanation with a very relatable example. Keep up the good work.👍
@CodeBeauty
@CodeBeauty 4 жыл бұрын
Thanks. 😊 I wanted to use something different from the examples that are usually used because there are a lot of those on the internet, so this came to mind. I'm glad that it's clear and understandable.
@rameshwarprasad4722
@rameshwarprasad4722 4 жыл бұрын
@@CodeBeauty Being a supporter and beneficiary of your content and knowledge I would like to praise you for choosing to teach C++ because C++ is one of those tools that have immense power but people avoid it because it requires deeper understanding. I surely believe that every fundamental topic related to memory , cpu and all that power c++ has we will be able to witness it on this channel with your kind efforts. Consider it just a mere suggestion. And thanks for the videos.👍🙏
@clasherboytanjim5576
@clasherboytanjim5576 11 ай бұрын
I just love u and your smooth explanation ❤❤
@leonardopantoja7121
@leonardopantoja7121 3 ай бұрын
Me gusto el video, hasta el momento voy entendiendo. Gracias.
@felicytatomaszewska2934
@felicytatomaszewska2934 2 жыл бұрын
She is the most beautiful coding teacher
@tumusiimebrian3745
@tumusiimebrian3745 3 жыл бұрын
Thank you so much Saldina... keep going.... waiting for videos on Vectors🙏🙏🙏pliiiiiiiiiiz🛐
@vivekanand5900
@vivekanand5900 3 жыл бұрын
The way you explaining I started falling in love with coding..😇❤️
@haroldthibault9921
@haroldthibault9921 2 жыл бұрын
don't be fool ! be aware that Beauty is really ...a beauty. She has aesthetic physical attributes ! You might have fallen in love with the teacher instead, which is good, anyway, to increase the learning slope !
@venkatmancha
@venkatmancha 4 жыл бұрын
Clear n awesome lecture...
@MissChelsie24
@MissChelsie24 3 жыл бұрын
Very helpful!
@riadchebitou7459
@riadchebitou7459 Жыл бұрын
You're so talented keep the good work
@jorgetxjr
@jorgetxjr Ай бұрын
Thank you!
@kayracan3663
@kayracan3663 3 жыл бұрын
You both teach us code and show us beuty i love you for that
@legolas5684
@legolas5684 4 жыл бұрын
Keep going!
@engineering6217
@engineering6217 Жыл бұрын
you are the best teacher...love from india.
@sarahabdelaziz179
@sarahabdelaziz179 Жыл бұрын
Thanks for you effort.🙂
@RC-hi5sj
@RC-hi5sj 3 жыл бұрын
I learned a lot thanks
@diana_dev
@diana_dev 2 жыл бұрын
Your videos are amazing!
@ephraimokoriko2926
@ephraimokoriko2926 2 жыл бұрын
I really wish I got to know about your videos two years ago
@nigahzahra6402
@nigahzahra6402 3 жыл бұрын
Great work mam, Please make vedio on object relationships: association, aggregation and composition.
@killaburribo
@killaburribo 2 жыл бұрын
you explain this much better than my professor, thank you!
@dev.antunes
@dev.antunes 3 жыл бұрын
Obrigado, Saldina! =)
@Hiracreationalz
@Hiracreationalz 6 ай бұрын
Thank you so muvh for these videos
@Vovastrugac
@Vovastrugac 3 жыл бұрын
Big thanks for your work !
@CodeBeauty
@CodeBeauty 3 жыл бұрын
My pleasure!
@georgeemmanuel3155
@georgeemmanuel3155 2 жыл бұрын
Hi! Saldina, please will you show me the different between Abstraction and Encapsulation. these two principles are always confusing me, please I need your assistant. Thank you!
@gourikirti5100
@gourikirti5100 11 ай бұрын
Amazing work
@salmanahmadsultanmohammad1231
@salmanahmadsultanmohammad1231 3 жыл бұрын
What is the difference between encapsulation and abstraction ?
@ulquiorra417ify
@ulquiorra417ify 2 жыл бұрын
Muchas gracias! :D
@builder6189
@builder6189 3 жыл бұрын
Keep Rocking !
@hafizmuhamad5966
@hafizmuhamad5966 3 жыл бұрын
very clear explanation, im from malaysia
@user-ox1is2th6f
@user-ox1is2th6f 10 ай бұрын
i am asking about the small buttons you use when you open those constructors small buttons in number 12 and 13 how did you do that how did you hide?thank you
@information23703
@information23703 2 жыл бұрын
very nice explanation.Love from Kashmir.
@mufindmakaya4516
@mufindmakaya4516 3 жыл бұрын
so amazing your videos
@mahmoudyosry9409
@mahmoudyosry9409 4 жыл бұрын
thank you for that , i found your channel by coincidence and i found you are a great instructor that provides a clear explanation , i like the way you provide an example, keep going. can you explain move constructor , copy constructor , move assignment , copy assignment in next videos??
@CodeBeauty
@CodeBeauty 4 жыл бұрын
Thanks a lot! Some of those topics are already on my TODO list! 🤓
@ashrsfsiliman452
@ashrsfsiliman452 3 жыл бұрын
Thank you for your great job
@CodeBeauty
@CodeBeauty 3 жыл бұрын
🥰🥰
@user-ox1is2th6f
@user-ox1is2th6f 10 ай бұрын
hi may i ask how did you hide those info constructors number 12 and 13 im asking the button in the left what command you use?thank you stay safe
@gmmkeshav
@gmmkeshav Жыл бұрын
Love you for making videos in night for us
@subee128
@subee128 2 жыл бұрын
Thanks
@chityinoo6150
@chityinoo6150 2 жыл бұрын
i really love u teacher Saldina
@hkjhh2363
@hkjhh2363 2 жыл бұрын
Hi Saldida, thank you for video. Are you going to post video about setters and getters as well?
@day4834
@day4834 2 жыл бұрын
Hi, you may find some useful information here www.w3schools.com/cpp/cpp_encapsulation.asp
@technicalteam3298
@technicalteam3298 Жыл бұрын
you are really a nice teacher, till now I am not able to grasp the concepts of oops but because of your lucid explanation I am able to make it. thank you so much 🙂 getter setter methods-- public: void getter(){ int ChannelName = " peaky blinders"; } void setter(int setname){ setname = ChannelName; }
@diegocamposjimenez666
@diegocamposjimenez666 Жыл бұрын
how are you using integer values to strings? What compiler are you using that didn't underline this error?
@basit3037
@basit3037 Жыл бұрын
@@diegocamposjimenez666 lmao thats funy xD
@thiruselvan5499
@thiruselvan5499 Жыл бұрын
you are really a nice teacher, till now I am not able to grasp the concepts of oops but because of your lucid explanation I am able to make it. thank you so much 🙂 getter setter methods-- public: void getter(){ int ChannelName = " peaky blinders"; } void setter(int setname){ setname = ChannelName; } should be int ChannelName str ChannelName right
@stellaroasis
@stellaroasis 10 ай бұрын
@@thiruselvan5499 its still set to int , change it to string
@lickguitars1276
@lickguitars1276 10 ай бұрын
would we need a getter if we had a class method, if we had a private member would we need a constructor
@Abhishek_Poddar
@Abhishek_Poddar 3 жыл бұрын
Ma'am...lots of thanks ...for these .. quality contents...these are literally so much understandable and relatable...plz keep it on... I have a doubt which may sound silly to u...😅but i m not able to click it in my mind... That one of the main purpose of using encapsulation is security too ...but i wanna say what's the security left if we can access the data members via getter and setter ..? I' m not able to get it .. though i have tried to google it everywhere also in ur other video of combined lecture of cpp .. I hope i'll get my anwer ❤️😣😣 Plz take a piece of code of "employee security of a company"
@afrazhussain3778
@afrazhussain3778 3 жыл бұрын
mam why you use string name why not char*name is making pointer a good practice for string or not
@Rawan-cx9xk
@Rawan-cx9xk Жыл бұрын
can u explain linked list and stack please with oop?
@40wattstudio41
@40wattstudio41 Жыл бұрын
Ok, this is one I'll have to study more . . . .
@philosophia5577
@philosophia5577 Жыл бұрын
which font you are using in your editor tab?
@shubhamkambale7515
@shubhamkambale7515 2 жыл бұрын
Hi please make video on data structure and algorithms please...........
@andrewsavage4557
@andrewsavage4557 2 ай бұрын
You look great as your content ❤
@riddhabose9653
@riddhabose9653 4 жыл бұрын
Please make a video on C++ STL ! Amazing Work 👍!
@CodeBeauty
@CodeBeauty 4 жыл бұрын
That could be a topic for some of my future videos. I'm interested though, do you need it for school, work, or are you doing competitive programming or something else? ☺️
@pranjalverma9171
@pranjalverma9171 4 жыл бұрын
@@CodeBeauty For CP perspective
@pranjalverma9171
@pranjalverma9171 4 жыл бұрын
Till then can u suggest some resources to move forward!
@riddhabose9653
@riddhabose9653 3 жыл бұрын
@@CodeBeauty I personally need it for competitive programming. If you can make a video on it, it would be really great !
@Local.man.
@Local.man. 9 ай бұрын
thank you
@anuragghoshh
@anuragghoshh 2 жыл бұрын
Everytime you were explaining the source code, My attention was on your source code. Everytime you ran the program for the output, My attention was on you!!😍❤👅
@ZeeshanAbbasiplanz
@ZeeshanAbbasiplanz Жыл бұрын
so setter takes value, getter prints value is that it
@3yousif
@3yousif 3 жыл бұрын
why we have to put them in private and then create a method to modify them. private means we constantly want them to be untouched ; do we learn that for future need or I miss understand something
@CodeBeauty
@CodeBeauty 3 жыл бұрын
Why should we use encapsulation when it is much easier to access and change properties if we don't? That is a good question. The answer is because we don't want to allow other developers to change and access everything they want, but we want to expose only properties that they should be able to see and change, and they can use them only if they obey the rules that we define. In that way, our data stays safe from outside misuse, because if you allow someone to have full permissions and do whatever he/she wants, it's just a matter of time when that person will wander off the intended way of building that system, create some complex overkill logic that is hard to understand, make things very dependent on one another, write duplicated code, etc. So there are many benefits related to encapsulation: easier to maintain the code, hides the data, easier to test, reusable... Let me give you one simple example of an application that can be used only by people that are 18+ years old. When the user registers, he enters his age, and there you have to check if his age is >18. If it is, he should be able to use the app, but if it is not, throw him an error. Imagine also that the mentioned application has the option to edit user data. That means that the user can change his age after registration as well, so you would have to check again if age >18 and behave accordingly, so writing the same code once more. And then, if all of a sudden someone decides that the app will be for people who are 21+ only, you have two places where you need to make that change. (This is a simple example, changing 18 with 21 is easy, and having two places where you need to do that is easy, imagine having some complex logic that you need to change in 20 places) What you can do instead is you can do the "age >18" logic in the setter, and save the user's age if he is >18, and then write an error is he is not. That way each time that you want to set a value for the Age property, the same logic is executed, and each time that you have to change something, you do that in one place only. 😊
@MrCoral821
@MrCoral821 3 жыл бұрын
Love your content ! Thank you and send love from Israel
@limemmontassar3690
@limemmontassar3690 2 жыл бұрын
from palestine ? GOOD
@MrCoral821
@MrCoral821 2 жыл бұрын
​@@limemmontassar3690 Funny. Can I encapsulate brainwashed comments?
@milanrai1556
@milanrai1556 3 ай бұрын
your code @5:23 is not running in MacOs, xcode.
@ronjackson8829
@ronjackson8829 3 жыл бұрын
Does push_back turn the list into a vector, as in PublishedVideoTitles.push_back(title)?
@NoNameNoShame22
@NoNameNoShame22 3 жыл бұрын
No, it simply adds an element.
@madalinavarga3337
@madalinavarga3337 3 жыл бұрын
i accepted your challenge and thank you
@arijkhan2516
@arijkhan2516 2 жыл бұрын
for your setName function, you should have this-> name = name. So that this way the computer knows which name you are referring to!
@ShepardCommander11
@ShepardCommander11 2 жыл бұрын
If anyone was curious about the above, basically you use "this->" to access the private data field variable (Name) and assign the private data field variable the parameter variable of the method (Name) that the user will specify in the main(), whether its hardcoded " " like CodeBeauty is doing, or user inputted via a cin.
@webslesson4u937
@webslesson4u937 2 жыл бұрын
Love your content! Thank you and send love from Pakistan
@BrainyBlas
@BrainyBlas 5 ай бұрын
Everyone should subscribe for both beauties,Code beauty and actual beauty
@edeathg1459
@edeathg1459 2 жыл бұрын
nice bubaa, btw really nice video
@infiniteone783
@infiniteone783 4 жыл бұрын
The more I watch, the more I realize C++ is a lot like Java, or at least the basics seem to be. Getter & Setter string getName() { return Name; } void setName(string name) { Name = name; }
@CodeBeauty
@CodeBeauty 4 жыл бұрын
C++ is a very powerful language, and it has strongly influenced many other languages, among them is Java. Because of that, there are a lot of similarities between them. But you can find some important differences as well, especially if you dive deep into both of those languages. Yep, that is the example of setter and getter! 😊
@tanyatyagi3649
@tanyatyagi3649 5 ай бұрын
Thankssss
@garvitrajput8491
@garvitrajput8491 4 жыл бұрын
please make a vidoe on c++ stL !
@yolamontalvan9502
@yolamontalvan9502 3 жыл бұрын
Yeah, I use them a Lot, but she seems to know stuffs that I don’t know.
@kmalnasef1512
@kmalnasef1512 3 жыл бұрын
Thank you before watching this video I thought encapsulation means that we should put data and the methods relate to those data inside a unit called "class " !!!
@alonalon8794
@alonalon8794 2 жыл бұрын
By accessing private variables via public methods, the principle of encapsulation isn't violated? In other words, what's the difference between accessing private variables through public methods and defining the variables as public and then accessing them directly?
@day4834
@day4834 2 жыл бұрын
I read that it's good practice to declare your class attributes as private. Also, you only allow access to those private attributes you want for data security purposes.
@sidratultushin4879
@sidratultushin4879 Жыл бұрын
My students, focus on what you are here for🙂
@sofienbenmahmoud1563
@sofienbenmahmoud1563 2 жыл бұрын
saldina i love you
@yahatkunnarak1919
@yahatkunnarak1919 Жыл бұрын
🔥❤
@dev.antunes
@dev.antunes 3 жыл бұрын
So, Encapsulation is all about making get and set methods for properties and raw methods, like in Java?
@CodeBeauty
@CodeBeauty 3 жыл бұрын
Yep, OOP concepts are the same for all OOP languages, and encapsulation is one of those concepts. There is also an example in the description of the video that might be interesting to read related to "why to use encapsulation" 😊
@antran540
@antran540 3 жыл бұрын
@@CodeBeauty what is the point of encapsulation because users are still able to modify private members indirectly through methods?
@barsyilmaz3485
@barsyilmaz3485 3 жыл бұрын
@@antran540 is right. I agree with him. What's your idea?
@mcalex4747
@mcalex4747 3 жыл бұрын
@@antran540 The subscriber part for example, it's by 1, If someone subscribes to you, you won't have 1 mil subs, but 1. If the user can choose how many subs should be, it won't be ok. So you have a rule, and you make the user respect it.
@root8272
@root8272 2 жыл бұрын
@@antran540 The theory is that you have the ability to change the way it gives an actual value if you need to. For example, if you needed to perform a calculation on the raw data, and that calculation might change over time, then you can rest assured that the consumer of your class will get the proper values back without having to change their code because you can make the change in your getter method, and the consumer doesn't have to deal with the calculation in their own code. If it's a setter method, it could validate data beyond something like a simple defined datatype could do. Due to differences in feature sets between languages, it works better in certain languages than others, and I can't say whether C++ is actually the best language to be doing this. The important thing is that if you're working on a code base that does utilize this, you know what is going on. It's a very common practice in the industry due to the popularity of Java, and its heavy use of this style by Java programmers. Prior to Java, this was not the way to do things. In recent times, there has also been some push back on this.
@relytheone853
@relytheone853 3 жыл бұрын
Been aware of programming for years, but never programmed anything.
@CodeBeauty
@CodeBeauty 3 жыл бұрын
Try a couple of tutorials from the beginning and let me know how it goes. Welcome! 😊
@ziquaftynny9285
@ziquaftynny9285 3 жыл бұрын
I've been aware of astronauts for years too, but never gone to space...
@abbassadri5099
@abbassadri5099 Жыл бұрын
Lovely outfit😍
@alexzanderegwuatu6298
@alexzanderegwuatu6298 3 жыл бұрын
You pretty and so smart.. thank u
@rohitjoshi2384
@rohitjoshi2384 Жыл бұрын
Excellent teaching.. with a bit of (soft) distractions....mmmm actually two of them...😶
@vsp2611
@vsp2611 11 ай бұрын
Hottest Coding Teacher Award goes to Saldina Nurak❤❤
@shinymp7691
@shinymp7691 3 жыл бұрын
Wow.
@ThiyaguShanmugam
@ThiyaguShanmugam 4 жыл бұрын
I just came to see u, never mind about the topic.
@mrfred456123
@mrfred456123 4 жыл бұрын
Lol Me Too... I saw her on Traversy Media Channel
@mujibulhaquetanim
@mujibulhaquetanim 4 жыл бұрын
Tharki😂
@raunvk
@raunvk 3 жыл бұрын
Simp
@codecspy3479
@codecspy3479 3 жыл бұрын
Why is encapsulation even needed if we can anyway access and update the data variables declared as private using member functions. What are we hiding here ? We are just not letting the user to directly access the data variables but indirectly we are letting the user to access them using member functions. We are not hiding anything here !!! Correct me if i am wrong.
@kamalsabki8103
@kamalsabki8103 3 жыл бұрын
At least in most OO languages, encapsulation is roughly equivalent to the lock on the door of a bathroom. It's not intended to keep anybody out if they really insist on entering. It is intended as a courtesy to let people know that entering will lead mostly to: embarrassment, and a stinking mess. "answer founded in stackoverflow "
@codecspy3479
@codecspy3479 3 жыл бұрын
@@kamalsabki8103 Thanks for this. Its clear for me now. !!
@user-vo9pd5yc3f
@user-vo9pd5yc3f 7 ай бұрын
turn off the cam i cant focus😂
@andrewsavage4557
@andrewsavage4557 2 ай бұрын
😂
@aj4337
@aj4337 3 ай бұрын
Learning from your channel in 2024 and It's really helpful and easy to understand std::cout
@CodeBeauty
@CodeBeauty 3 ай бұрын
I'm happy to hear that ❤️
@adnanaman4391
@adnanaman4391 9 күн бұрын
What are the informal resources you used while learning cpp for the first time? ​ Love from Bangladesh ❤ @CodeBeauty
@kingrobert6249
@kingrobert6249 2 жыл бұрын
❤️
@shuvrodas932
@shuvrodas932 3 жыл бұрын
void getname(){ cout
@ADAM-qd9bi
@ADAM-qd9bi 3 жыл бұрын
Nice
@root8272
@root8272 2 жыл бұрын
This actually isn't a valid getter because it doesn't return anything.
@miaflorida9410
@miaflorida9410 7 ай бұрын
Damnnn you are really pretty absolutely amazing
@subhammishra3433
@subhammishra3433 2 жыл бұрын
Kya teacher m yr.... Ab toh isii se padhna h
@fusiontv5269
@fusiontv5269 3 жыл бұрын
9:08
@mechee1747
@mechee1747 3 жыл бұрын
Isn't it common practice to put a "_" at the start of every private variable to easily see that it's a private variable? Example: string _Name, _OwnerName; int _SubscriberCount;. My background involves Arduinos which gave me a good base knowledge on C++ but I'm learning the language outside of the Arduino platform. Your videos made that process so much easier. Keep up the good work!
@root8272
@root8272 2 жыл бұрын
This naming convention varies by code base. It's best to do it if that is what is already being done everywhere else or if there is a rule/style guide that mentions it, but it is certainly not considered a de facto way of doing things in C++, and there are some who actively discourage it.
@diegocamposjimenez666
@diegocamposjimenez666 Жыл бұрын
Well, as root said, it varies between developers as I like to use underscored names in the class method instead.
C++ OOP - What is inheritance in programming?
16:32
CodeBeauty
Рет қаралды 139 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 11 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 11 МЛН
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 6 МЛН
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 309 М.
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,5 МЛН
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 87 М.
Bluetooth connected successfully 💯💯
0:16
Blue ice Comedy
Рет қаралды 1,9 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 64 МЛН
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
Yanlışlıkla Telefonumu Parçaladım!😱
0:18
Safak Novruz
Рет қаралды 1,4 МЛН