To set the stage, let me note that I've worked on several applications, across many programming languages, with quite a few different development environments. However, after several weeks of development, I have come to the conclusion that iPhone development is quite possibly the worst environment for development of an application I have come across yet.
Okay, you're hooked now, right? What am I going to say that's bad about XCode, Interface Builder and Objective C? Well, let's set that aside for the moment and discuss what's good about the environment first:
- XCode's refactoring tool may be the best I have ever seen -- just right click on a symbol, provide a name, click preview and apply. It even integrates with Subversion nicely, so I don't have to worry about renaming the files in Subversion first. The only thing that I haven't been able to get XCode to refactor properly was a category I applied to a built in class, which is understandable.
- The provided iPhone simulator is great! It's a great way to build and test without an actual iPhone connected to your computer.
- There is an amazing amount of detailed documentation. (If you can find it, more on that below.)
So, what's so bad about it? Here are the highlights:
- Objective C. In order to build an application of any complexity, Apple has forced developers into learning and developing with Objective C. Now, I know there's a good deal of history there, but this is a language that has roots in the 60's, and it shows. There is so much cruft just to get a simple class in place that I cringe, and often want to avoid proper OO design, and avoid good testing practices, just because of the nasty overhead involved. The square bracket message passing syntax is a nightmare to type out and read, and difficult-at-best to indent properly for multi-line messages. Finally the ridiculously long names and function calls with arguments leave you with no choice but to have either strange linebreaks in your code or to have lines that are 200+ characters long.
- XCode. I see things online all the time about how good XCode is, so maybe there's something wrong that we're doing here at Cogi, but we all hate XCode. In particular, it doesn't help you with navigating around many open files, and wants to impose it's idea of "groups" on top of your particular file system layout. You actually have to jump through hoops to create a hierarchy of folders that makes sense.
- Interface Builder & UIFramework. Why can't you set anything on an object in Interface Builder that you can do programatically? Why aren't UITextField and UITextArea related objects?1 This area in particular is particularly difficult to get to work at all until you've read all of the hundreds of pages of documentation that Apple has made available.2
- No way to simulate phone calls. As far as we've been able to find, when running your code in the iPhone simulator, there is no way to simulate either incoming or outgoing phone calls. In the real world, applications have to deal with this -- with no way to test this in a simulator, this requires a full build, deploy, test, and place a phone call cycle, just to discover that your change may or may not work as you expected.
So, all that said, where do we go from here? Well, at Cogi, we are continuing to develop an outstanding iPhone application that our customers will love -- us developers will just have to continue to suffer through some amount of pain and frustration along the way.
1. This issue is particularly frustrating. So much so, that I will likely be writing more about it in the coming weeks.
2. Apple could learn a lot from the Pythonism: "Simple is better than complex." (from the Zen of Python).
Nicely put Chis.
ReplyDeleteAnother headache is the key stroke differences between Xcode and other IDE's. For example, going to the beginning of a line I just hit my HOME button in most IDEs, but in Xcode that takes me to the beginning of a file. It takes two keys (CMD <-) to get to the beginning of a line ... just little things, but they can make a big difference in productivity.
I suspect there are ways to customize, but then that creates problems for others when they sit down at my computer to help out and they keystrokes are non-standard.
That particular issue is mostly just a Windows vs. OS X peculiarity. The Home key in OS X almost always takes you to the beginning of a file in OS X applications (not saying that it's intuitive or "right", that just the way it is in OS X).
ReplyDelete