Do I have to learn Objective-C for professional Mac Development? [closed]
Asked Answered
O

17

21

Do I really have to learn Objective-C to develop solid Mac Apps?

As Mac users tend to use only applications that have a nice (native) GUI, i don't think that Mono and GTK+ or any Java GUI (Swing) will fit their needs.

There are projects like Cocoa#, PyObjC and RubyCocoa, but are they ready for primetime?

So do I really have to learn Objective-C ? I would prefer a dynamic language.

Obstruct answered 7/11, 2008 at 16:43 Comment(7)
Cool, I'd like to know this too.Roop
I feel the pain of learning to :(Languishment
Objective-C has dot notation for properties now. But I agree: Objective-C is hard. Let's go shopping!Overcloud
not really "hard" but there so much noise in the code syntax, it hurt my eyes when I read objective-c code.Languishment
At first I found the smalltalk message passing syntax a bit difficult, but I have to disagree. I think it makes it easier to read and understand code once you get used to it. For instance: math.divide(5, 2); Which is the divisor? Conventions says the 2 but [math divide:5 by:2]; is very clear.Centrifugal
@Languishment probably because you haven't read enough to be accustomed. Every new syntax will look alien at first. It took me about one to two weeks to get fully used to it.Interne
Actually, Objective-C is a dynamic language. You should really read the runtime documentation.Premonitory
C
34

Objective-C is a dynamic language, as far as the Objective-C parts go. Here's a little summary article: http://www.macdevcenter.com/pub/a/mac/2003/04/28/objective-c.html

The syntax is scary at first, but it grows on you. I suggest biting the bullet and slogging through it.

If you want to work at a "real job" doing Mac programming with other people, you're going to need to know Objective-C (in my opinion, anyway).

Cretin answered 7/11, 2008 at 16:49 Comment(2)
Objective-C is actually really good. I've been developing in C# since its inception so Objective-C was a hurdle at first, but I've really come to like it.Priapitis
As for the square brackets, this might be helpful: #142976Unesco
W
13

I think the short answer is yes, you need to learn Objective-C.

The Python and Ruby "bridges" work, but it's not what Apple is pushing or using itself. A few years ago there was a Java bridge to Cocoa but that's now deprecated. Who knows what will happen to the non-ObjC languages?

In any case, Objective C is pretty dynamic. Not in the way that Ruby/Python are perhaps, but it's certainly not like C++.

Whoa answered 7/11, 2008 at 16:52 Comment(1)
This may not have been the case when this answer was written (I don't remember), but Podcast Producer on Mac OS X Server is written in Ruby.Premonitory
U
12

Short answer: YES :)

Unesco answered 7/11, 2008 at 16:52 Comment(1)
Longer answer: YES, and if you try to avoid it you will only cause pain to yourself and your users.Authorize
M
9

Our first app was built in Python, using the PyObjC bridge. From experience I can tell you that to build an application with a bridge you need to learn:

  1. The idiosyncrasies of the bridge
  2. To read and write code in the bridge language (Python in my case)
  3. To read code in Objective-C (All useful sample code is in Obj-C)
  4. To write pseudo-code in Objective-C (if you ever want to ask questions on a mailing list or likewise)
  5. Cocoa

Of all those things to learn, Cocoa is the biggy. It's where the really interesting stuff comes in and the thing you really need to wrap your brain around. After working on this PyObjC project, it's become pretty easy for me to code in Obj-C, even though I had no prior experience coding in C.

So my advice is: Focus on learning Cocoa, and use the language that's most suited as a tool to do that (Obj-C). If you ever find a particular reason to use a bridge, such as having a need for an ORM that can deal with networked SQL, etc. you can apply around 90% of what you learned writing your first Obj-C/Cocoa app(s) in the bridged project.

Finally: I don't really understand the resistance many people who're new to the platform have to learning Objective-C. Isn't it exciting and gratifying to learn new stuff and build the best possible things armed with this new knowledge?

Mabe answered 9/11, 2008 at 12:59 Comment(2)
Us ex-Newton developers are spoiled - XCode/ObjC just seem really cumbersome compared to NTK/NewtonScript.Forerunner
Frankly, I think Objective-C is hard to like. I've learned Objective-C, and I don't like it at all. The more I use it the less I like it. I'm interested in moving from Objective-C to Python (which I find more productive and fun).Copperas
M
5

You definitely need to learn Objective-C even if you choose to use one of the bridges. Apple has already shown by their treatment of Java that they're not really interested in providing huge amounts of support or backwards compatibility to the use of Cocoa through anything but Objective-C.

So use one of the bridges, if you like, but have a firm grasp of the Objective-C runtime and the bridges so that you can manage them yourself, if need be.

Montford answered 7/11, 2008 at 16:55 Comment(0)
P
4

Do I really have to learn Objective-C to develop solid Mac Apps?

Currently, yes.

As Mac users tend to use only applications that have a nice (native) GUI, i don't think that Mono and GTK+ or any Java GUI (Swing) will fit their needs.

Correct.

There are projects like Cocoa#, PyObjC and RubyCocoa, but are they ready for primetime?

Cocoa#: I don't know, as I don't use C#.

PyObjC: Sort of, but Cocoa in Python is a bit of a hack, since Python isn't Smalltalky enough.

RubyCocoa: Maybe. I'm waiting for MacRuby to mature, though. See also:

Punke answered 7/11, 2008 at 22:48 Comment(1)
Yeah, don't mess with RubyCocoa. MacRuby is coming along really nicely. Especially hotcocoa.Premonitory
O
3

There are a small number of successful Cocoa apps written in bridged languages, so you don't necessarily need to use it that much, but you do need to learn it. People who try to learn to write Mac OS programs in bridged languages do themselves a huge disservice. The bridged languages are great tools, but they are the sort of things that allow someone with a knowledge of the bridged language and Objective C to become extra productive, not skip learning Objective C.

In order to use something like PyObjC or MacRuby effectively you need to really have a good understanding of how the native runtime works to deal with all the impedance mismatches that can occur between the bridged language and the Objective C runtime.

Ottar answered 7/11, 2008 at 18:33 Comment(0)
O
1

Short answer is yes, longer answer is "you can use Objective-C++." Either way you're going to have to learn at least some of Objective-C. Once you start digging into Cocoa (the framework for building Mac OS X apps), the Xcode tools, and the Apple Human Interface Design guidelines, you'll realize that Objective-C is the way to go.

Overcloud answered 7/11, 2008 at 16:55 Comment(0)
N
1

Not only you have to know Objective-C (the easy part), you must be very comfortable with plain old C. That's in my opinion the biggest challenge for most people.

Numbskull answered 7/11, 2008 at 16:57 Comment(4)
I don't think that you need to know any of the "hard" stuff in C to be an effective ObjC programmer. For most applications if you're using pointers and C strings, you're probably doing it wrong! Having said that, knowing C can certainly make you a better ObjC programmer.Whoa
in my book, if you're not comfortable with pointers, you have to right to call yourself a C programmer, and that includes Obj-C and C++Lipography
If you mean that you need to know the the basic c statements like "for" and "switch" I agree, but if you are talking about pointers, I disagree.Smtih
You need to understand pointers and C-magic of that sort in order to understand the workings of the Objective-C runtime, one of the most interesting things about programming in Cocoa or other Objective-C platforms. You may not think you need it, but your mind will a-splode with happiness every time you know that you understand how all this smalltalk-y magic is actually implemented.Premonitory
F
1

If you already know C, Objective-C is pretty easy to learn.

Ruby and Python are both viable for "real" Mac apps. ADC has a few articles on the topic. MacRuby looks like it will be replacing RubyCocoa.

I would still recommend learning Objective-C though. Most of the example code you find will be in Objective-C and the books tend to be Objective-C (though the Pragmatic Programmers have a RubyCocoa book in the works. Most Cocoa apps are written in Objective-C.

And Objective-C is dynamic. Take a closer look at it, it isn't nearly as intimidating as people think. It's Cocoa that tends to have the steeper learning (or unlearning) curve.

Feodora answered 7/11, 2008 at 17:2 Comment(0)
T
0

No you don't have to learn cocoa however it is worth looking at because it is an incredibly powerful api and very well documented, if you already know C then its very easy (honestly it is - i know it looks daunting syntactically).

The problem with the bridged approach on OS X is it seems to be very immature and only really designed for people who are prepared to read the documentation associated with the main cocoa api.

In all honesty if you know c you will pick up the basics of obj-c with a book, the one by Arron Hilligas (spelling?!?!) is superb.

Tusk answered 7/11, 2008 at 23:34 Comment(0)
S
0

If you try hard enough, you can go about producing software without using Objective-C that has the potential to be great except for the fact that at the end of the day it won't be very good. You will spend more time trying to harangue a language into doing something that it isn't the absolute best at. At WWDC I wore a shirt that said "Learn Objective-C or Retire" which didn't go over too well with some people who still held dearly onto the last threads of Pascal's life, but the point is altogether true - Objective C is where it's at on the Mac and to pretend otherwise is to do yourself a disservice.

Having said that, you should definitely not rule out the bridges on the platform for extending your application - Bill Bumgarner is quick to point out how much power the Twisted networking framework provides to Cocoa applications via the PyObjC bridge.

Slowwitted answered 8/11, 2008 at 6:3 Comment(0)
T
0

Not programming in a scripting language turns out to not be so bad when you're using XCode. The GDB integration is very good; I'm primarily a Perl guy, and I find the XCode debugger very nice and very easy to use.

The "fix" feature will really surprise you with how usable it is. Imagine finding a bug in your ObjC code, fixing it, and then telling the debugger to continue on. It actually works in a lot of cases.

Try ObjC. You may find you like it a lot better than you think you will.

Tiliaceous answered 21/11, 2008 at 20:47 Comment(0)
B
0

"have to", well... technically, no.

Since most Mac app jobs are done thro ObjC (for a very good reason I might add), I wouldn't kid yourself and learn it.

Bacchus answered 15/4, 2009 at 4:39 Comment(0)
F
0

Hell no. You can use a number of languages to make a nice GUI with. It just depends on what's the usual/easiest solution for the platform. In Mac OS X's case, Objective-C and AppKit are pretty easy to use choices. However, I use REALBasic sometimes, and that allows cross platform development (and, of course, a performance hit).

So really it depends on how much work you want to put into it. You should learn Objective-C if you want to really do serious Mac development. But you can get by without it....

Focus answered 15/4, 2009 at 5:9 Comment(0)
D
0

No. While Apple is strongly pushing Cocoa, Carbon is still supported. It uses plain C instead. As for good-looking GUIs, just use Interface Builder.

However, I must say that Objective-C is a great language. It is really easy (it was my first language) and very powerful.

Dichotomous answered 3/12, 2010 at 3:4 Comment(0)
L
-2

In general yes; but even if you (correctly IMHO) ruled out Mono, GTK and SWING because they don't fit well in the GUI, try Qt. it's REALLY respectful of Mac GUI standards (HIG: Human Interface Guidelines), and can be equally programmed on C++, Python and Java. the last version is cocoa-based and 64-bit capable.

the only thing missing from Qt that you'd get from Objective-C is those awful non-HIG-compliant modern Apple applications (yeah, Aperture and Final Cut, I'm looking at you!)

Lipography answered 7/11, 2008 at 17:31 Comment(1)
Sorry, I've never, ever seen a Qt application that actually looks like it fits in with Mac OS. It may be the fault of stupid-headed developers, but any Mac app that is remotely beautiful has not been done with Qt. To my knowledge. I'd love to be corrected on this with an example, though.Premonitory

© 2022 - 2024 — McMap. All rights reserved.