Comments on: Objective-C Is The Language http://www.red-sweater.com/blog/2256/objective-c-is-the-language Mac & Technology Writings by Daniel Jalkut Sun, 16 Mar 2014 19:39:31 +0000 hourly 1 http://wordpress.org/?v=3.8.1 By: Richard Stallman http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266583 Tue, 08 Nov 2011 14:26:39 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266583 The memory management mechanism is a shit. It is based on naming conventions. And with the properties have more turns.
Typification is a mixture of weak and strong, with the type id. If you call a method on this type throws a warning, but if an object is assigned to do an implicit cast (though it throws warnings if you want to assign a protocol implemented!)
It has constructors
Delegates are strongly based on, but no inner classes
No null pointer validation, it simply returns null. Go encountered an error when chained method calls.
It has no namespace, such as packages.
There is no decent bookstores mechanism. In many cases you have to get third-party sources in the application.
Methods have no visibility specifiers. Or are public or are private.
To make private methods to do a trick with a category (or declare them before you call).
There is a protected visibility.
In reality there is no private, because if you invoke a method on the interface is not run it without problems (only gives a compiler warning)
It makes some automatic castings. For example, id to any type. Or a superclass to a subclass (but when the subclass has a protocol throws a warning!)

]]>
By: Nik http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266581 Tue, 08 Nov 2011 14:18:23 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266581 If you come from c/c++ maybe Objective-C looks nice. Less so if you’re coming from Java (which makes way more sense) or Ruby (which is the most elegant language).

[note: I don't consider c-compatibiltiy an asset in any way - I'd be happy if Apple dumped that tomorrow. pointers? really? give me a break]

Criticisms: The brackets are dumb. Pointers are dumb (though I’ve gotten so used to it by now that I don’t even see the ‘*’ in front of everything). The:method:names where you have named parameters (but you can’t omit one, or define defaults) are dumb. The header files are… well OK they’re fine. Manual memory management is dumb – although they now have automatic compile time memory management which looks super interesting. Anyway having to count references is crazy, and if it weren’t for properties I’d probably have given up. Encapsulation is unheard-of. Subclassing and constructors are weird and fiddle-y.

Good things: Categories. Wow. How I love categories. LOVE IT. General object-orientedness, though I dislike the primitives all over the frameworks. Ruby does that right: Everything is an object, and deal with “efficiency” where that sort of thing belongs, in the compiler / interpreter.
And… frameworks. I am truly impressed with the quality of the frameworks for UI stuff and also for core stuff. The frameworks are fantastic. If you’ve ever written a user interface in Java, discovering Apple’s UI frameworks is a relegation. That’s how it’s supposed to work. Yeah!

AppCode, which is a full on IDE vs the glorified text editor that is Xcode 4. Just like Eclipse/IDEA do for Java, AppCode removes a lot of the shortcomings of Objective-C. For example, it generates/synthesizes/deallocs properties with one click. It has refactorings that work well. Etc.

]]>
By: Paul Richardson http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266295 Tue, 08 Nov 2011 00:52:34 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266295 Eiffel anyone ??

]]>
By: MAGSHARE http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266218 Mon, 07 Nov 2011 21:50:23 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266218 My first language was hex code, punched directly into memory locations, set the PC to the first one, and start the processor.

Compared to that, C was like magic.

I did twenty years with C++, and, along the way, have learned lots of languages, but the strangest was XSLT.

I now run a shop that does C++ HPC. There’s no other language that comes close, when you want raw performance. You also want good (read: expen$ive) geeks writing it. It’s not a good language for the faint of heart.

I like O-C. I got used to the bracket syntax (from SmallTalk). It’s OK.

A lot of these languages came from architects, trying to force bad programmers to write good code.

Good luck with that…

]]>
By: Benjamin Ragheb http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266152 Mon, 07 Nov 2011 19:40:42 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266152 I have trouble taking seriously people who whine about the square brackets.

]]>
By: Richard Durr http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266074 Mon, 07 Nov 2011 16:57:30 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266074 The interesting parts of ObjC are Smalltalk.

]]>
By: Andy Lee http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266046 Mon, 07 Nov 2011 15:10:13 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266046 It’d be cool if Objective-C 3.0 could remove the square brackets and use true Smalltalk-like syntax. F-Script proves it can be done.

If it would help to give the compiler hints, the requirement could change to have just one top-level pair of square brackets enclosing any messaging statement or top-level expression:

foo = [MyGraphPoint pointWithX: xField floatValue y: yField floatValue];

[self graph plotPointAtX: foo x y: foo x];

I might have my precedence rules for Smalltalk syntax mixed up, but it would be something like this, with parens as needed for grouping. The brackets would tell the compiler, “Here comes some Smalltalk.”

Removing the brackets, which some people find ugly, would be consistent with Apple’s trend of making things easier for newcomers to the platform. I suppose there would still be people uncomfortable with Smalltalk syntax.

]]>
By: mkonutgan http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266044 Mon, 07 Nov 2011 15:03:35 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266044 I too was ‘forced’ to learn C++ (and now Java) in college. Of course, I’m just a student and don’t know as much as any of you guys, but for the last two years I have been learning Ruby, C and Objective-C in my free time and doing things and writing small apps and I must say I adore Ruby for its elegance and complete object-orientedness and I find (pure) C very fun to write mainly because of its simplicity and because of my fascination for the low-level. I find Objective-C also very nice, with advantages of both, though I haven’t used it that much and I prefer it to C++ or Java.
Now macruby sounds interesting, but I’m worried about how long and how much Apple will actually back it up.

]]>
By: Charlie @ HockeyBias.com http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266039 Mon, 07 Nov 2011 14:45:55 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266039 [I too_can_not_stand: [the nested_bracket: [syntax: sorry]]]

I find it practically violent.

…I do the bulk of my programming C# and prefer it in many ways.

]]>
By: Tim Bartle http://www.red-sweater.com/blog/2256/objective-c-is-the-language/comment-page-1#comment-266021 Mon, 07 Nov 2011 13:44:41 +0000 http://www.red-sweater.com/blog/?p=2256#comment-266021 Just for the record, Objective C was not “Apple’s response to object-oriented programming” – Objective C was developed several years before NeXT or Apple started using it by Brad Cox and Tom Love. http://en.wikipedia.org/wiki/Objective-C

]]>