Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > The benefits of Obj-C...

The benefits of Obj-C...
Thread Tools
RIRedinPA
Senior User
Join Date: Apr 2005
Status: Offline
Reply With Quote
Feb 17, 2010, 02:21 PM
 
I work for a publishing company and have been building AppleScript Studio apps for about five years now but using AppleScript and some shell scripts when I needed a little extra heavy lifting. I also have extensive web experience with PHP, Javascript, AJAX, etc. With the announcement of the iPad and my own desire to make myself more marketable and build mobile apps I'm digging into Obj-C and Cocoa.

Conceptually it's not too difficult, once you have one language down all the others for the most part have a core that behaves similarly. Nor is the syntax that bad, it'll just take some time to get use to having to declare variables (though you do declare vars in JS) and the peculiarities of the language. What I am having trouble seeing is the benefit. There just seems to be a lot of extra lifting in Obj-C to do the same thing one could do with AppleScript...

so other than the obvious I need to know this to develop on the iPhone and/or iPad what are the benefits over say building an app using Obj-C as opposed to AppleScript - speed, memory, potentials? (Note: I've built fairly detailed stuff in AS using AppleScript - an Adobe Bridge like application that let's users upload and view images and create a database record of those images and move them to proper locations on our servers, time tracking app). Why is it whenever I sit down with Obj-C the light bulb doesn't go on for me, I don't get an aha moment where I see the benefits and turn with disdain to AppleScript...

so someone make the argument for this language for me...

thanks...
Take It Outside!

Mid Atlantic Outdoors
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 17, 2010, 03:09 PM
 
For one, Objective-C code will run much faster than equivalent Applescript code. Applescript was not designed to be a full app development language. Besides speed, its expressiveness for creating data structures and algorithms is somewhat limited (that's not to say you can't write them, but they're more ungainly). It also doesn't interact well with libraries like CoreFoundation and CoreGraphics.

Just on its benefits as a language, though, I wouldn't say Objective-C is a great language. It's an OK language, generally better than C++ or Java, but not as good as Ruby, Python, F# or any number of other languages. The primary benefit of Objective-C is that it's the native language for Cocoa — which is a pretty huge benefit when you're writing a Cocoa program. For example, the syntax for calling Cocoa methods in Objective-C is much more natural than in any other language, even other languages designed especially for Cocoa like MacRuby and Nu.

At any rate, I would say any language that does not have Applescript's awkward syntax is a step up. Most programmers can't stand the language. It's not just that the syntax is unusual, but that it's quirky, verbose and not at all straightforward. I do all my AppleEvent scripting in Ruby these days.
( Last edited by Chuckit; Feb 17, 2010 at 03:16 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
RIRedinPA  (op)
Senior User
Join Date: Apr 2005
Status: Offline
Reply With Quote
Feb 17, 2010, 03:26 PM
 
>>At any rate, I would say any language that does not have Applescript's awkward syntax is a step up. Most programmers can't stand the language. It's not just that the syntax is unusual, but that it's quirky, verbose and not at all straightforward<<

Thanks for the reply. Oddly enough those are the very things I like about AS. But, if I can remember my personal programming development history it goes something like HTML, ASP, some Javascript, AppleScript, REALBasic, PHP, a lot more Javascript...so AS has that old shoe thing going for it with me.
Take It Outside!

Mid Atlantic Outdoors
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:50 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,