On May 19, 2008, at 12:03 AM, Peter Duniho wrote:

From: ben syverson <[EMAIL PROTECTED]>

This is going to sound bitchy, but it's hard for me to have any
sympathy for vague complaints about the docs or the usability of
Cocoa.

That does sound bitchy. I mean, it's fair enough to say that people ought to be providing specific feedback and constructive complaints. But to have _no_ sympathy? That's harsh.

No, you misread me. I wrote that I have no sympathy for *vague* complaints. I'm sympathetic to people like yourself who have "specific feedback and constructive complaints."

I think when all is said and done, most of this discussion can be chalked up to taste. For example, I hate C++. It's ugly, doesn't fix the problems in C, and implements a style of OOP that I find unusable. Java is basically the same as C++, and seems relegated these days to the ghettos of CS101 and JSP. C# is yet another knock-off of C++. It's all down to opinion, but if those were the only three languages out there, I wouldn't write code.

The Obj-C way makes much more sense to me. Even the syntax itself encourages program to be more readable -- would you rather encounter something like this:

imgWatermarkScale(image, rect, false, 0.5, true);

...or this, which tells you exactly what it's doing?

[image scaleToFit:rect cropToRect:NO withQuality:0.5 andWatermark:YES];

And when would you use dynamic typing? For me, it's just about every day. NSArray and NSDictionary can contain a mixed bag of any kind of object. Imagine you have an app where users can select multiple items of different types -- images and sounds -- so they can copy + paste them. What if you want them to be able to hit the "Rotate Right" button with multiple items selected, even though it only makes sense for images?

for (id anObject in userSelection) {
        if ( [anObject respondsToSelector:@selector(rotateInDegrees:)] )
                [anObject rotateInDegrees:90];
}

Now if you add a new type named Movie to the app, all you have to do is implement the rotateInDegrees: method for the Movie class, with no change at all to your "Rotate Right" code.

Of course, you should only use dynamic features when you need them -- most of the time, it's nice to have the compiler tell you that you're passing the wrong kind of object to the fourth argument of method XYZ.

Anyway, I could go on and on about how much I love Obj-C. I would encourage you to keep at it. It really shouldn't be such a massive and torturous investment of time -- just start with simpler apps and slowly increase the complexity...

- ben

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to