2 ms·
What are your complaints specifically? In the beginning I also hated it (mainly because it was on a platform I didn't care much about). But the more I wrote Obj
by flohofwoe 3y ago
What are your complaints specifically? In the beginning I also hated it (mainly because it was on a platform I didn't care much about). But the more I wrote ObjC (mainly in context of Metal) the more I started to appreciate the "minimal elegance" which is the complete opposite of C++ - I don't appreciate the fact that every object access is a dynamic method call though ;) (but that's where C comes in)
Typically I wrap the ObjC code which needs to call into system framework in subsystems which then expose a simplified C API (same with C++ libraries, wrap the C++ shim under a simplified C API), so that most platform- and library-agnostic code is written in plain C.
ObjC never got in the way though, and the nice thing is that (unlike C++) it supports the latest C features.
- pjmlp 3y agoOn my case, plenty of @ [] to type. C++ already supports more C than it should.
- flohofwoe 3y agoObjC 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.)