whisper at oz.net (Dave LeBlanc) writes: > Since self is used for every method of every class, isn't it a bit > redundant? Many people find it less confusing to read code that is written this way. Otherwise, when you see a variable, you have more choices as to where the variable might be defined: the local scope, the global scope, the class scope, etc. > I don't know of another OO language that makes you manually carry > around the "this"/"self" pointer/reference... Languages with multimethods routinely do, because multimethods are typically not class-centric. I.e., a generic function in a language with multimethods dispatches on all the arguments, not just on one of them, so no particular argument is given special treatment. For class-centric OO languages, I agree with you -- I don't personally know of any others that require explicit use of self. |>oug
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4