Hacker News new | ask | show | jobs
by gress 4588 days ago
I'm not sure I understand what you mean by that. Dot syntax is a way to refer to properties independent of the usual message sending syntax. How can it not be about properties?
1 comments

Because... it's not?

Declare a plain getter method:

    -(id)foo;
Call it with dot syntax:

    id foo = obj.foo;
Works fine. Now declare it as a property:

    @property id foo;
Call it without dot syntax:

    id foo = [obj foo];
Works fine. They are completely unrelated and just introduced at the same time. You could take dot syntax out of the language without affecting properties in the least. You could take properties out of the language without affecting dot syntax in the least.

(There is one exception to this, and that is the part where dot syntax understands and calls custom getter/setter names for properties. But that is the only place where they even touch, and it certainly doesn't mean they're somehow integrated.)

If you define 'properties' as only use of the @property directive, then what you say follows.

However that's a pretty arbitrary definition, since properties pre-date the introduction of that directive.

Well no, the wishy-washy "properties are certain kinds of methods that we can't really define in a particularly concrete manner" definition of properties is the arbitrary one. Saying that properties are those things which are declared with @property is pretty non-arbitrary. That's the definition the compiler users, that's the definition the runtime uses, and that's the definition I use.

Using the wishy-washy definition doesn't help, in any case. Nobody would say that e.g. autorelease is a "property", but you can still call it with dot syntax.

I seriously doubt your intellectual integrity here.

You know that the dot syntax is a mechanism that matches with the conventions for property access, and no other access pattern.

You also know that its possible to call zero argument methods that aren't accessors using the dot syntax.

I don't believe that you think that this is the purpose for which the dot syntax was designed, and yet you bring up 'autorelease' to support your position.

As I said, based on your specific definition, you are correct, but using denigration, a false straw-man 'quotation', and dishonest examples doesn't make your definition fit the evidence.

As I said, and you sidestepped, properties pre-date the directive, therefore the directive cannot be the sole definition of what properties are.

You've decided that I must agree with you, and the only reason I could possibly disagree is that I have no intellectual integrity.

Well, how the fuck can I argue against that? Sure, you must be right. Clearly I could not possibly disagree with you for any other reason.

Seriously, fuck off.

You aren't reading what I wrote. I didn't decide you must agree with me. I accepted your point of view and told you why mine differs.

You then went on to argue that your point of view was the only reasonable one.

If you addressed the actual question instead of being aggressive and insulting, we might have had an interesting technical discussion.