6 ms·
ObjC 2.0 introduced dot-syntax for property access, gets rid of most of the [] (but still is a two-edged sword, because it looks like a cheap operation, but is
by flohofwoe 3y ago
ObjC 2.0 introduced dot-syntax for property access, gets rid of most of the [] (but still is a two-edged sword, because it looks like a cheap operation, but is a method call under the hood).
The '@' might look ugly but it's a good way to separate ObjC keywords from C and C++ keywords, so that ObjC can introduce new keywords without risking to break existing code.
(but this like complaing that Python uses tabs for scope blocks, or that C and C++ have too many {}, it's just a matter of getting used to it)
- pjmlp 3y agoDot syntax does nothing for regular messages. Forgetting how hard they are to type in some keyboards, depending on locale? Not everyone is using US layouts.
- flohofwoe 3y ago> Forgetting how hard they are to type in some keyboards, depending on locale? { } is just as bad on German keyboard layout ({} is right-Alt 7/0 and [] is right-Alt 8/9 - on Windows at least, don't even remember on the Mac). That's basically why I switched to English keyboard layout right after I left the Amiga (which actually had a decent German layout for programmers). > Dot syntax does nothing for regular messages. True, but at least in the Cocoa and Metal code I usually write, there's a lot more property accesses than traditional method calls.
- Apocryphon 3y agoXcode autocompletes the closing brackets!
- waffletower 3y agoThe whitespace significance of python will never be an equivalent comparison here. Whitespace significance adds unnecessary parsing and meta-programming complexity, and adds a significant vector for subtle and difficult to detect errors in code and data (in Python, YAML etc.)