4 ms·
Also note that if this is done by hits, that it is no wonder objective-c has such a high jump. I've been programming in C/C++ for a decade and objective-c stil
by alttab 17y ago
Also note that if this is done by hits, that it is no wonder objective-c has such a high jump.
I've been programming in C/C++ for a decade and objective-c still confused the crap out of me for my first iPhone app.
- tptacek 17y agoWhat tripped you up the most? I just re-re-learned it, and: * How to handle type 'id' * Formal protocols (informal protocols I get just fine) * Autorelease
- iron_ball 17y agoI'm learning it now, and although nothing is confusing me yet, the un-named first argument to each method is a pretty amazing wart. The designers never saw "nameOfMethodWithFirstArgument:(Type )arg1 secondArgument:(Type )arg2" and decided to rethink things? Why not?
- yan 17y agoHow would you design it?
- iron_ball 17y agoMaybe I'm missing something obvious, but why not nameOfMethod: firstArgName(Type '')arg1 secondArgName(Type )arg2? So you'd get invocations like this: point = createPoint: x:10 y:15; Instead of this: point = createPointWithX:10 y:15; edit: no idea how to get asterisks to appear, so pretend I have pointer symbols where appropriate.
- MWinther 17y agoYou can go unnamed for all your arguments, no need to feel the first one is being left out. [object method:1 :2 :3] is valid. =) On the other hand, Objective-C encourages verbosity, and in well-defined methods, I have a hard time considering calling the first argument unnamed.
- alttab 17y agoFor being a "C" language I found it an abomination of syntax. For being a "C" langauge I found the memory management confusing - I new, I release - you do everything or nothing, not some things sometimes and nothing other times. Don't make me check the documentation to know if something is autoreleased. Beyond those initial frustrations - the thing I liked about it the most is I could seamlessly call out to my C/CPP files and work in a non-proprietary language. You know objective-c? Awesome, but what about other platforms?