Learn to Code via Tutorials on Repl.it!

← Back to all posts
Private & Protected Attributes
Monk1 (12)

Protected attributes

_name - The way of warning that the attribute is better not to be used outside of the class at the agreed in level.

Private attributes

__name - The way deny access to attributes/methods outside the class, but this way of privatization can be circumvented. To completely exclude access to attributes outside the class, you must use the Accessify module.

FishballNooodle (211)

A suggestion for future tutorials is you give a more detailed explanation outside of the coding area. Explain how each line works, you can get more upvotes this way as well.
Keep it Up!!!