3 ms·
>Having to reference self makes it more clear where data is coming from and makes navigating an unfamiliar code base much easier. I don't understand this. Asid
by coldtea 7y ago
>Having to reference self makes it more clear where data is coming from and makes navigating an unfamiliar code base much easier.
I don't understand this. Aside from people seeing an OOP for the first time in their life, are they getting confused about where "this" comes from?
How would an implicit "self" a la "this" make it any less understandable where the data come from?
How is passing self making "navigating an unfamiliar code base much easier"? Aside from total newbs who see an OO codebase with an implicit instance variable for the first time?
- fireflash38 7y agoI believe the original commenter was more referring to the lack of 'this' usage in Java. So instead of having: this.x = y People tend to do: x = y Which isn't always the most clear that it's referencing an instance variable rather than a scoped variable, especially if you see it midway through a method.
- coldtea 7y agoA, alright then. I'd go with making this mandatory in that case.