The use of `this` keyword
In Python, the self
keyword is mandatory when accessing instance variables and methods from within class methods. Because of that, I was a bit surprised when realizing that in C# the this
keyword is optional when referring to instance members (fields, properties, methods) from within an instance method of the same class.
This finding is similar to what I previously learned when understanding the differences between Python import
and C# using
(see previous post). They make me think of the Zen of Python’s line:
Explicit is better than implicit.