

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Encapsulation
incomplete
2: Not Security
incomplete
3: Wizard Duel
incomplete
4: Encapsulation in Python
incomplete
5: Wizard Duel
incomplete
6: Encapsulation Practice
incomplete
This lesson's interactive features are locked, please to keep using them
Encapsulation is all about making code easy to work with by "hiding" complicated code within a "black box". It makes it so that we don't have to worry about details of how a function or method works... we just use it.
It's kinda like how the inner workings of your car's power steering are hidden from you. You don't need to be an expert on hydraulic systems to turn the wheel from side to side.
Let me say this next part loud and clear:
Encapsulation and the concepts of private and public members have NOTHING to do with security. This really confused me as a new developer. Just as the casing on your computer hides its inner workings but doesn't stop you from opening the case and looking inside, encapsulation doesn't stop anyone from knowing how your code works, it just puts it all in one easy to find place.
Encapsulation is about organization, not security.
Encapsulation is like storing folders in an unlocked filing cabinet. The cabinet doesn't stop anyone from peeking inside, but it does keep everything tidy and easy to find.