Damus
Helge Heß · 10w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqncxka2nmkqkndk4wkuf3tz3l39z9m8xax3aen3h8tvudwgjmf5mq4uv2v2 I still like this one in the context: https://blog.metaobject.com/2014/06/the-safyness...
David Chisnall (*Now with 50% more sarcasm!*) profile picture
@nprofile1q...

That’s a fairly superficial analysis and doesn’t really look at the properties that a modern type system enforces. First, it’s looking at Smalltalk vs Objective-C. About the only serious bug you can have in Objective-C if you use id everywhere is where two classes have selectors with the same name and different signatures. This can cause stack corruption (which is why, in libobjc2, we use the types as well as the name for dispatch and treat them as different selectors).

It more or less directly reinforces my experience in Objective-C: the type annotations almost never caught bugs, they were useful solely for documentation. I can’t understate the value of this though: I found reading Objective-C far easier than reading Smalltalk because things like ‘this method expects a string’ were explicit, whereas Smalltalk didn’t do this and required me to read more code to understand it.

But the superficial ‘is x a subtype of T’ is a tiny fraction of what you can express with modern type systems and it’s the rest of the functionality where I catch bugs.
1
Marcel Weiher · 9w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqncxka2nmkqkndk4wkuf3tz3l39z9m8xax3aen3h8tvudwgjmf5mq4uv2v2 nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqgqn4mglfftd6292303jp2r060qwy69mpgdfprlumsuhf68wft27svfzgz0 The blog post in question does not look at Smalltalk or Objective-C at...