Best programming language for Mac

Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
I bet this is a really silly question for anyone to be asking? Infact I know it is...
I wanna know which language is preferred by the Mac Development Community in general.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
None of the above.

Objective C is.
 
Joined
Sep 19, 2008
Messages
302
Reaction score
4
Points
18
Location
Nottingham, UK
Your Mac's Specs
20" iM ac,13.3" Aluminium Unibody Macbook, iPhone 4
I use Java..but only because I only know that and VB.net lol
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
None of the above.

Objective C is.

Ok... someone needs to clarify with me about C and its variants.

I know that C++ is a higher level variant of C which supports things that C does not... i.e, object orientated programming.

what exactly is Objective C? And when compared with a program written in C how is the execution speed?
 
Joined
Mar 15, 2007
Messages
161
Reaction score
4
Points
18
Your Mac's Specs
17" MacBook Pro, 2.33GHz C2D, 2GB RAM
Ok... someone needs to clarify with me about C and its variants.

I know that C++ is a higher level variant of C which supports things that C does not... i.e, object orientated programming.

what exactly is Objective C? And when compared with a program written in C how is the execution speed?

Objective-C is like C++ in that it takes the C language and adds object-oriented (OOP) features to it. However, it is very different from C++ in its implementation of those features (evidently it is closer to Smalltalk, although I'm unfamiliar with the latter). The biggest differences are that Objective-C is a relatively lightweight extension of C when compared to C++, and that Objective-C evaluates messages sent to receivers (approximately an analog to calling a method on a C++ object) at runtime, rather than making those connections at compile time.

Objective-C is the preferred language to program Cocoa applications in if you want good performance and are not building a cross-platform app. If you go through Apple's documentation on Cocoa, you'll see that the primary language discussed is Objective-C. Also, you cannot access the Cocoa frameworks directly from either C or C++ ... you would have to use some sort of a wrapper (which would undoubtedly be written using Objective-C).

I haven't done any timing, but I'd guess that for standard C constructs, the execution time of Obj-C code is essentially identical to C (and hence somewhat faster than C++). When using the Obj-C extensions, obviously it is going to be a bit slower than straight C code (just as C++ is), but you're getting the benefits of OOP in exchange.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
I haven't done any timing, but I'd guess that for standard C constructs, the execution time of Obj-C code is essentially identical to C (and hence somewhat faster than C++). When using the Obj-C extensions, obviously it is going to be a bit slower than straight C code (just as C++ is), but you're getting the benefits of OOP in exchange.
If its similar to C++, how fast is Objective C compared with? Or does that depend on the programmer??
 
Joined
Mar 15, 2007
Messages
161
Reaction score
4
Points
18
Your Mac's Specs
17" MacBook Pro, 2.33GHz C2D, 2GB RAM
If its similar to C++, how fast is Objective C compared with? Or does that depend on the programmer??

Like I said, I haven't benchmarked them. For basic function calls and such I'd expect Obj-C to be a bit faster, but beyond that it would likely depend upon the specific types of operations being performed. Certainly C++ can perform almost as well as C or far worse than C, depending upon what you are asking of it. And it ALWAYS depends upon the programmer. :Smirk:

However, any decision between C++ and Obj-C should not be predicated upon performance, because there are more important factors to be considered. If you want to write Cocoa applications for the Mac, then Objective-C is the right choice, there's no question about that.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
Objective C Resources and tutorials

I've searched for resources online for Objective C like tutorials and stuff. But the only results I get are always assuming I have knowledge about C, which I don't. I looked for a forum, couldn't find a dedicated one like there is for C/C++.

I went Amazon and looked for books. So far, I like two books by Stephen G. Kochan "Programming in Objective-C" & "Programming in Objective-C 2.0 (second edition)".
Does anyone know which of the two I should go for??
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
I've searched for resources online for Objective C like tutorials and stuff. But the only results I get are always assuming I have knowledge about C, which I don't. I looked for a forum...

Learn C for Cocoa

That site also has some other good introductions. They may be a bit dated as far as which version of XCode they are using, since Apple has made some changes to it and IB (Interface Builder).

The most suggested book is Cocoa Programming for Mac OS X.

You can get a free Apple Developer account and get access to more tutorials and information that way.

If you haven't programmed before, then I suggest you start with a scripting language. This has been discussed here several times.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
Learn C for Cocoa

That site also has some other good introductions. They may be a bit dated as far as which version of XCode they are using, since Apple has made some changes to it and IB (Interface Builder).

The most suggested book is Cocoa Programming for Mac OS X.

You can get a free Apple Developer account and get access to more tutorials and information that way.

If you haven't programmed before, then I suggest you start with a scripting language. This has been discussed here several times.

Thanks for the links. I've been to these links before and yes they are helpful, only of you are a person who used C before. Even the book you mentioned assumes that you are familiar with C/C++.
Objective-C would be my first programming language. I apologise for not mentioning that earlier.... O:)

Thats the reason I chose the books I mentioned earlier.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
as always, it depends on what you're doing. There are things for which perl is the way to go, others bash scripting, C, and Objective C.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
What I've learned is, that when it comes to programming, the language used always depends on the project at hand. However, there is a underlined fact that some programmers will stick with a particular language no matter they are trying to do.

Now to the topic at hand. It is now confirmed that Obj-C is the official language for Apple development. Since it is, I've chosen it as the language I will learn for programming on my mac.
Now all I need is a good book for a programming beginner to use.
 
Joined
Mar 15, 2007
Messages
161
Reaction score
4
Points
18
Your Mac's Specs
17" MacBook Pro, 2.33GHz C2D, 2GB RAM
I'll be honest: if this is your first foray into software development, I worry that you might be jumping in a little too close to the deep end of the pool. But if you are dead set on getting to Objective-C as quickly as possible, then I'd at least suggest that you start by just learning C first, as everything you learn there will be directly applicable to Objective-C. Perhaps someone else can recommend a good book on C for a beginner. (I learned C from the pre-ANSI K&R ... i.e., "The C Programming Language" by Brian Kernighan and Dennis Ritchie, 1st ed. ... but it wasn't my first language, and that book wouldn't be a good text to use as an introduction to programming.)

After you've learned C, Apple has a downloadable PDF on Objective-C (for C programmers) that might be helpful for you in making the transition. You'd need an Apple Developer account to get that PDF. After you understand that and some of the basic tenants of object-oriented development, you could try to get started on learning the Cocoa framework with one of the books mentioned earlier in this thread.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
Joined
Mar 15, 2007
Messages
161
Reaction score
4
Points
18
Your Mac's Specs
17" MacBook Pro, 2.33GHz C2D, 2GB RAM
Joined
Nov 5, 2008
Messages
3
Reaction score
0
Points
1
Location
London
Your Mac's Specs
Big Machine
and let's not forget about Applescript. Despite all it flaws, it's quite a nice way to ease yourself into the world of programming. And thanks to Applescript Studio, you can create quite sophisticated interfaces for your Applescripts which is always satisfying.

I tried learning Objective-C a few years ago using Stephen G. Kochan's book but failed to get my head around it. I then switched to Applescript Studio and that allowed me to crowbar my way into programming. Since then I have read Stephen G. Kochan's book again and it all made much more sense.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
and let's not forget about Applescript. Despite all it flaws, it's quite a nice way to ease yourself into the world of programming. And thanks to Applescript Studio, you can create quite sophisticated interfaces for your Applescripts which is always satisfying.

I tried learning Objective-C a few years ago using Stephen G. Kochan's book but failed to get my head around it. I then switched to Applescript Studio and that allowed me to crowbar my way into programming. Since then I have read Stephen G. Kochan's book again and it all made much more sense.

Learning a new language is hard. Whether it be verbal communication (french, spanish, chinese, etc) or programming (C++, Java, etc), the key element is vocabulary. The larger your vocabulary in that certain language, the more fluent you are. When learning a new language, it all about understanding the terminology.
 
Joined
Jan 14, 2009
Messages
15
Reaction score
0
Points
1
I am just getting myself started out in programming.

What order should I go in? Does it make sense to learn C first? Where do I go from there?

Thanks.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
I am just getting myself started out in programming.

What order should I go in? Does it make sense to learn C first? Where do I go from there?

Thanks.
People will argue that learning C from the ground up is the only "proper" way to learn to program correctly.

I would contend that C might force you to program very precisely and do a lot of low-level stuff yourself - but it's quite tricky to learn and you won't be able to do anything "cool" for quite a while.

I'd start off with something that's a little easier like Ruby, Java or Python to explore things. You can then easily move to another language later once you've learnt the general concepts.

For OS X programming Objective C is the way to go, but there's quite a learning curve here as well.
 
OP
knightjp
Joined
Jun 22, 2007
Messages
347
Reaction score
2
Points
18
Your Mac's Specs
iMac (27 inch, Late 2012), Processor: Core i5, Memory: 16GB 1333 Mhz DDR3 running MacOS Catalina
I am just getting myself started out in programming.

What order should I go in? Does it make sense to learn C first? Where do I go from there?

Thanks.

I agree with Aptmunich in the sense that learning C will take time and if you are completely new to programming, you will feel a little confused about the jargon used.
Learning something high level is more easier. I would suggest applescript.

However if you still feel that you want to learn a full-on language from the start, go in the for the below book....

Amazon.com: Programming in Objective-C 2.0 (2nd Edition) (Developer's Library): Stephen G. Kochan: Books

So far I found this to be the best. Its critically acclaimed to take someone from being a complete novice to a pro in Obj-C.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top