Underscore variable name?


#1

Hello everyone,
What does underscore before a variable name means?

For example: _itemName

Is this because instead of typing self.itemName, we can type _itemName for short?


#2

[quote=“phucnguyen”]Hello everyone,
What does underscore before a variable name means?

For example: _itemName

Is this because instead of typing self.itemName, we can type _itemName for short?[/quote]

No, its just a naming convention. To differentiate instance variables.