3 ms·
Oh man, am I guilty of not using dot syntax consistently. I actually try not to use it because it is so out of place with the rest of the code, but it's a lefto
by eddieroger 14y ago
Oh man, am I guilty of not using dot syntax consistently. I actually try not to use it because it is so out of place with the rest of the code, but it's a leftover habit from other languages, and old habits die hard.
- mikeash 14y agoI would argue that never using it counts as "consistently", as long as this isn't in dire conflict with the parts of the code that other people wrote.
- bitwize 14y agoObjective-C dot syntax is fucktarded. The dot is a structure-member indicator; why are you using it on a value of pointer type? The thing is, Smalltalk has a perfectly good getter/setter convention that's almost as compact and straightforward: for a property called 'foo' the getter is called 'foo' and the setter is called 'foo:' (takes one arg). Apple could have used this convention in its method synthesizer (they opted to make the setter the somewhat more awkward 'setFoo:') and everybody would be clear on what was a struct member access and what was a message sent to an object. But no.