PROGRAMMING
To be or not to be an object: On the problem of self reference
To be or not to be an object: On the problem of self reference
The self reference (an object’s way to refer to itself) seems to be handled very differently across object oriented languages. While in static java-like languages the this keyword is magic, straightforward and mostly unused, in Javascript the magic can be confusing. Yet again in Python some would describe it as “redundantly explicit”. In another dynamic language, Ruby, the self acts very similarly to Java’s this, but methods aren’t objects there either. Is this variety of behaviors due to random design decisions, or is there some common pattern in all these OO languages?