Hugoware

The product of a web developer with a little too much caffeine

iPhone vs BlackBerry – A Developer’s Tale – Part 1

with 9 comments

Here is the plan: Develop two mobile apps, one for BlackBerry and one for iPhone at the same time to see what is easier for a .NET guy to whip out — then blog the whole thing into a series of posts! Brilliant!.

Crazy – You Bet!

So the original project was simply to develop an iPhone app but I figured that since I was putting so much work into the mobile web service why not do two apps at the same time! Since most of the heavy lifting is going to be done by using C# and ASP.NET MVC then It shouldn’t be that hard — will it?

For this series of posts I’ll be keeping track of the iPhone development using my MacBook Pro using Xcode and Objective-C and the BlackBerry development using my Dell XPS using Eclipse and Java. I’m going to try and keep track of the hours spent – but I can guarantee I won’t have a stop watch with me at all times.

Let’s see what happens!
versus

Getting Set Up

This post is probably isn’t going to be very interesting since this mainly goes over getting the two environments setup. You’ve been warned! 🙂

[BlackBerry – 2.5 hours]

Since programming with BlackBerry uses Java I immediately downloaded the latest version of Eclipse along with the SDKs from the BlackBerry website. I got everything downloaded and installed in less than 40 minutes (even though the BlackBerry website wasn’t the easiest thing to navigate)!

So I fired up an instance of Eclipse and started a new project — and… uh… what the heck? My keys aren’t working? I tried closing and reopening and rebooting — nothing! The keys simply would not respond. As it turns out the problem was the BlackBerry SDK itself! Basically, the newest version of Eclipse wasn’t supported so that meant I had to find a previous version (3.4) and use it instead — bummer.

So after downloading Eclipse (again) I was ready to go. I started a BlackBerry project, pasted in some sample code to play around with, hit run and — CRASH! I’ll save the dramatics here but basically the UAC in Vista was kicking in and causing the emulator to die. Disabling it fixed the problem (but turned off UAC which isn’t what I wanted… but oh well). I had considered reverting this back to my VM of Ubuntu but since I had already invested so much time I figured I’d just stick with it.

After I finally figured out how to get the emulator started then it wasn’t long before I had my first “Hello World” program running and the BlackBerry was in business! Not too bad!

[iPhone 4.5 hours]

My new Mac came in the other day and I was ready to get started. Downloading the correct Xcode was a little confusing at first but once I got it figured out I had it up and running without any of the problems I had with Eclipse (although it was a 2GB download – whoa!)

The whole Mac keyboard/touch pad thing is terrible if you’re used to using keys like END, HOME or Right-Clicking (which I’m assuming developers use quite often :)). Even things as simple as resizing a window are painful on a Mac – but really its irrelevant for this discussion.

As s C# developer it wasn’t hard to look at Java code and get a general idea of what was going on. Even the entire Eclipse IDE acts similar to Visual Studio so the learning curve was greatly reduced… but Objective-C… not so much…

I read the documentation on the Apple website several times, watched a couple terrible screencasts and poked around with the Xcode IDE and still nothing. If you haven’t ever seen Objective-C before, make sure to shield your eyes when you do. I can pretty much guarantee it won’t make a bit of sense.

Also, the Apple documentation made some bizarre suggestions on the correct way to define methods… Check out this little gem here…

…method names should interleave the name with the arguments such that the method’s name naturally describes the arguments expected by the method. For example, the Rectangle class could instead implement a setOriginX:y: method that makes the purpose of its two arguments clear…

What? Name your method to emphasize the first argument? Would Steve McConnell approve of this?

Project Status

BlackBerry (3%): IDE installed and sample is working!

iPhone (1%): IDE installed but haven’t been able to understand any of the code yet.

Currently, BlackBerry has the lead with the least development time invested. In fact, the BlackBerry is up and running with a sample application. But after looking at the designer for the iPhone interface it looks like once I get past the initial Objective-C hurdle then development may move a long much faster than I anticipated. Will BlackBerry maintain the lead or will the iPhone catch up? Check back for the rest of the series!

Advertisements

Written by hugoware

September 7, 2009 at 2:11 am

9 Responses

Subscribe to comments with RSS.

  1. As a C# developer to another, for the iPhone try to check out MonoTouch 😉 at http://www.mono-project.com/MonoTouch

    Mihai

    September 7, 2009 at 3:50 am

    • I definitely considered Mono since those guys are doing such a great job at it but since I was in the mood to learn something new I figured I’d stick with the defaults.

      I’ve played with Mono with my Ubuntu install and I was really impressed though (at least, I think it was Mono :))

      webdev_hb

      September 7, 2009 at 10:07 am

  2. If your strictly approaching this as a C# developer without any C/C++ experience, then of course your going to stumble with Objective-C.

    Unless you’ve spent time/years playing with pointers and pointers to pointers and understand what arrays are (just pointers), you will struggle with the basics of Objective-C as a C# programmer. If you are a C or C++ programmer than Objective-C would be fine.

    Java is much closer to C# than Objective-C will ever be. And for a true comparison, it is mostly about the time it’ll take a C# programmer to learn Objective-C than it is about for programming on the respective platforms (BlackBerry/iPhone).

    Bryanb

    September 8, 2009 at 9:53 am

    • That is actually the point of the comparison – What happens if you take a C# guy and throw him into the mobile development mix.

      I suspect from a programming perspective, Java is going to come along much easier than Objective-C — but if you take the superior interface designer tools with Xcode, then some of the advantage might slip away.

      In any case, I’m not suspecting that Objective-C is going to be easy but I do think that with some effort I’ll be able to hack my way through it 🙂

      Thanks for your feedback!

      webdev_hb

      September 8, 2009 at 11:45 am

    • Well it’s not that objective C is hard. It’s somewhat lacking with it’s definition of OOP. I do like the parameter naming concept.

      The problem is the UI of xCode. All of the shortcuts developers of Microsoft/jBuilder/NetBeans will complain and rightfully so.

      In the MS world we have every shortcut imaginable because it’s all about speedy development. xCode lacks about 30% of this, but with each version it comes closer.

      Accessorizer helps a lot and the new version of xCode helps too. The Home/End thing annoys me greatly.

      I wouldn’t expect a Mac developer to understand this and I have been flamed repeatedly for this. If you don’t use Resharper daily then you wouldn’t know. Just like communist countries keep thier people from the outside world. Out of sight, out of mind.

      With all that said I really like developing in xCode. It’s a cleaner UI and now it makes sense after fully writing a video game in openGL. And I would say I can write it now at close the same efficiency. When Resharper comes to xCode i will be faster then c# I believe

      Nick

      Nick

      September 11, 2009 at 10:49 am

      • Interesting perspective.

        Even though Objective-C doesn’t make a bit of sense I like to remind myself it’s still just programming – with a different syntax with a new framework… I hope 🙂

        webdev_hb

        September 11, 2009 at 1:05 pm

  3. I assume you’re building the same project on both platforms (ie a mobile app that does X)? Is that right? What kind of app are you building? (Or plan to build?)

    Ed

    September 16, 2009 at 9:03 am

    • You are correct – I’m developing several web services in C# and going to access them both from the mobile apps. It won’t be that complicated of apps… (I hope)

      webdev_hb

      September 17, 2009 at 8:52 pm

  4. i have done one iphone app and will like to ask how can i mack it run on other cell phone than this iphone

    shaun

    March 7, 2010 at 4:15 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: