Question

I've been programming in C,C++,C# and a few other languages for many years, mainly for Windows and Linux but also embedded platforms. Recently started to do some iPhone programming as a side project so I'm using Apple platforms for the first time since my Apple II days. I'm wondering what other developers that are coming to Mac OSX, Xcode and iPhone SDK think. Here are my impressions, so far:

  • Mac OSX: very confusing, I tend to end up with too many open windows and don't know what's where. Luckily there's the bird's eye view, without it I'd be lost. With the shell at least there's all the familiar stuff so that helps me a lot.

  • Xcode: doesn't feel as good as VisualStudio or Eclipse, the two environments I'm familiar with. I think I could get used to it but I'm wondering if Apple wouldn't be better off with Eclipse. Before I found the setting where all the windows are stuck together I hated it, now I can tolerate it.

  • iPhone SDK: strange indeed. I understand Apple's desire to control their environment but in this day and age it just seems a little sleazy and they are missing out on so much by destroying developer goodwill.

  • Objective-C: I've known about it for years but never even took a look at it. The syntax is off-putting but I'm actually very intrigued by the language. I think it's an interesting third leg between C++ and C#, both of which I like a lot. Is there any chance Obj-C will break out of the Mac sandbox due to the uptick in the popularity of Apple technology?

Curious to read your thoughts,

Andrew

Was it helpful?

Solution

I'm in the same boat as you (somewhat). I've been developing in C# for 7 years, ever since .NET 1.0. Over the past couple weeks I've been teaching myself Cocoa and Objective-C. Here are my impressions (note for note with yours)

  • Agreed in that clutter can be a problem. I tend to use Spaces heavily when developing in XCode (put XCode in one space, Interface Builder in another space, Instruments in a third space). If you don't have Leopard (and thus, no spaces), then use Command-H to hide your active window. Using that tends to clean things up quite a bit (however it'd be nice if you could command-h automagically the current window when command-tab'ing to another app).

  • I'm liking XCode more and more. I hate Visual Studio - I find it to be unstable, slow, and well, just kind of a crappy IDE. Comparatively I've found XCode to be fast, stable, and I like how it organizes and filters your files. I'm not too up on my XCode shortcuts, but I'm hoping there's a way I can quick-switch from one class to another (similar to ctrl +n shortcut in ReSharper). Intellisense could be better with regards to how it displays to the user, but I really like how it essentially creates a template and you can ctrl + / to jump to the next argument in a message.

  • I'm hating the documentation in XCode. The help system sucks, and for whatever reason it never finds what I'm searching for. I end up just googling for anything I need to know... I hope they improve the documentation. This is my biggest beef right now.

  • Not quite there yet, as I'm going through the full Cocoa framework for Mac desktops. So far I'm really, really liking what I see. One thing I will say is that it would be nice if the iPhone SDK allowed for garbage collection...

  • Objective-C - I've never used it, this is my first foray into it. At first I was kinda wierded out by the syntax and the square brackets for messaging, but it's really growing on me. It's so quick to skim a method and see the message calls that method makes. The more I use it, the more Objective-C just feels nice... however templating/generics would be a welcome addition to the language.

All in all, my foray into Mac development has been enjoyable, and I'm excited to start working (today! yay!) on some actual mac/iphone projects.

OTHER TIPS

I agree with your sentiments. Coming from Microsoft development tools (and eclipse) to XCode is kind of harsh. XCode just feels... unfinished in some respects. It certainly doesn't have the polish that I come to expect from VS and Eclipse.

The SDK is similar, much of it is poorly documented, and there are a lot of holes where you know something should be, but it just isn't. Trying to carefully control audio/video file playback is one example.

Objective-C, however, is great. I really like the language, despite its quirks and idiosyncrasies (messages to null isn't a run-time exception? really?) Once your C++ eyes get used to the syntax, loosely-typed anonymous messaging actually ends up being really cool to play with (if somewhat dangerous and prone to RTEs.)

I really want to jump on and start developing iPhone apps as well. I've done a bit of Motorola, Blackberry and Windows Mobile development, which were all cool and east to get into with good documentation, easy to access and install SDKs. So far, I feel Apple is being a bit elitist in the fact that it seems their development environment is only available on a Mac. I'm also, not quite liking their licensing concepts. If you want to be able to actually publish apps, you need to go through them, and they have the final say on whether you can or can't or whether your app is deemed acceptable to run on their superior product. It is my belief that they are making it more difficult for the open source community to maintain and produce applications or for the iPhone neophite, like me, to even get started writing apps for the products. There's a lot of bad things said about Microsoft, but, I have to say they get their APIs and SDKs out there long before their products hit the market and really encourage programmers of all levels to dig in and get involved writing apps for their frameworks and operating systems.

I have worked on a few small iPhone apps and I am just amazed that they didn't include the components of the framework that enable developers to easily access SOAP web services. Anyone else working in an enterprise IT environment feeling the pain?

I personally think that the documentation is very good at this point. On any Objective C class you can option-doubleClick to bring up the documentation for that term, and if there are any example projects using that particular class that's listed to (at least for many iPhone specific classes).

Also look into turning on Research Assistant when you are first starting out, and turn on Code Sense (don't think it's on by default). The combination of XCode + Interface Builder is quite powerful when you get used to it, and frankly in a few decades I have never used a better interface builder in terms of how the integration to code works or the ability to design interfaces that intelligently resize without a ton of extra work.

I'm new to iPhone programming and XCode too, after many years of programming for many platforms and my impression is rather close to yours (with some differences):

  • Mac OSX: I switched from Windows about 2 years ago (as an experiment) and I stayed :) - I don't think I'll switch back. Having a Unix foundation is very cool and I love the flashy GUI + I like the basic simplicity of the interface. It took me about 2 months to get used to it, but I can't imagine going back. I hate the MacBook keyboard layout and some of OSX's keyboard limitation though. It's funny how a company that is so proud of its usability insights can come up with such a lousy set of decisions. Perhaps the best examples are not having a context-menu (right-click) keyboard shortcut and the fact that you need two keys to accomplish tasks like Home, End, PgUp, etc. My main advice is to spend the time learning as many keyboard shortcuts as possible. I also recommend installing & using the following 3rd party apps that substantially improved my Mac experience: Quicksilver, Path Finder, 1Password, Things, TextMate, Text Wrangler & Transmit.

  • Xcode: I totally agree with you. I think XCode is rather primitive. I compare it with IntelliJ IDEA that I work with a lot and it feels like Apple is stuck at least 7 years in the past:

    • code navigation is so primitive with too many windows bouncing around
    • you have to use the mouse all the time
    • templating is very limited and is based on naive macro concepts with no relation to context or scoping
    • refactoring is limited to just a few simple actions
    • you can't even easily accomplish trivial tasks like overriding a method
    • Code Sense is nice but could have been much better if it understood typing...

    The big irony is that serious Mac developers don't even understand that they have a problem... They are so used to the mess they have to deal with that they can't imagine a better world... Instead of helping you, XCode keeps getting in the way. I can come up with dozens of examples about how this environment sucks, when compared to modern Java IDEs (Eclipse, IntelliJ), but I believe it's a waste of time - it seems like Apple is too proud to learn from others... which is funny if you consider the fact that the inventors of Java weren't shy to learn from Objective-C. My only advice (to myself too) is to take a deep breath whenever you open XCode and learn as much as possible from the experts who are more used to this environment.

  • iPhone SDK: it's even worse than that - we considered porting our mobile app to the iPhone a couple of months ago but decided not to bother because we were worried that Apple might reject it from the app store and you can't know in advance (they've rejected a somewhat similar app in the past on the ground that it's too close to iTunes!)

  • Obj-C: I find Objective-C quite nice and after a few days you get used to the awkward messaging syntax, but boy do I miss garbage collection... Having to deal with memory allocations and releases feels a bit like going back in time to my early C/C++ days. I'm just beginning to learn the nuances of this language, but so far I like what I found. There are quite a few tips scattered around the web about Obj-C best practices that you can't find in the official docs and I learned a lot from them (see for example the following discussion here on stackoverflow)

I came from a C# background as well and have been working with the iPhone SDK since beta 2. I totally agree with cranley about VS being a bit clunky compared to Xcode. Xcode is WAY different, and totally foreign when you start using it. So was VS though back in the day. Once you get by the learning curve it is a wonderful experience. The apps I am developing use C# server side (web service) and I absolutely hate having to switch to VS to write the web service code from Xcode. Obj-C is also quite fun to use once you learn how it works best: delegates (very different than .NET delegates), messages, Categories and all the other oddities present.

I did some Java and Flex programming previous to .NET and I always hated the .NET docs compared to Java docs. They just don't cut it. I have personally found Xcodes docs and search system to be nothing short of amazing. There are countless PDF guides linked from the docs that have tons of sample code. Think about this: the iPhone SDK has been out of beta for about 2 months now. The docs show a maturity level of many years. And yes, it is because Obj-C has been around over a year and the frameworks are similar.

Overall, the biggest issue I have found is that there are a LOT of .NET developers jumping on the iPhone bandwagon and trying to use Obj-C as if it were C# or VB. They fail to read the basic Obj-C docs let alone the iPhone docs and then they get very frustrated and eventually fail. The discussion forums are full of this scenario. iPhone programming is not easy. Learning a new language is not easy. It takes time and a lot of try.fail.try. It's not .NET so lose that mindset before you even begin and things will be wonderful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top