Do not understand the underscore syntax

Hello Everyone! I do not understand the underscore syntax could anyone explain it further? is it mandatory to use the underscore? thanks in advance

The underscore tells other developers (and ourselves) to only access the variable with a getter or setter and not access it directly, especially from outside of the class. There is nothing mandatory about it since it is a design choice of the author in compliance of the OOP model.

1 Like

Thank you very much Roy!! very helpful

1 Like