“But Mark, why does it matter that some methods are methods and some ‘methods’ are functions that take an object as the first argument?”

Theoretically? It doesn’t; the two are isomorphic modulo a little bit of bookkeeping convenience on an OOP system knowing the method is always associated with the object.

Aesthetically? Because I’d rather fix this shit in an implementation by writing a new function that is every bit the peer of the existing behavior, not “living off in a cupboard somewhere else because I didn’t get there first.”

More than anything else, my career being “fixing this without being able to modify the object” is the main reason OOP has lost its luster for me.

@mtomczak I always liked the idea of the Universal Function Call Syntax from the D language for this reason: en.wikipedia.org/wiki/Uniform_

@bhollis Oh yeah, this is much preferable to what I generally see.

I really need to make up an excuse to write something in D. Or Nim. I'm trying to remember: I think Lua supports something similar as well, though it's been awhile.

@mtomczak what I like about it is that it solves the IDE autocomplete problem - type a dot and you should be able to autocomplete all those eligible functions.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.