views:

2658

answers:

7

As a .Net developer I always dreamed for the possibility to develop with my existing skills (c#) applications for the Iphone.

Both programs require a Mac and the Iphone Sdk installed.

Appcelerator Titanium was the first app I tried and it is based on exposing some Iphone native api to javascript so that they can be called using that language.

Monotouch starts at $399 for beeing able to deploy on the Iphone and not on the Iphone simulator while Titanium is free.

Monotouch (Monodevelop) has an Ide that is currently missing in Titanium (but you can use any editor like Textmate, Aptana...)

I think both program generate at the end a native precompiled app (also if I am not sure about the size of the final app on the Iphone as I think the .Net framework calls are prelilnked at compilation time in Monotouch).

I am also not sure about the full coverage of all the Iphone api and features.

Titanium has also the advantage to enable Android app development but as a c# developer I still find Monotouch experience more like the Visual Studio one.

Which one would you choose and what are your experiences on Monotouch and Titanium?

+4  A: 

These are fun and interesting ways you can build iPhone apps. But, for truly rapid native iPhone development, your best bet is the free iPhone SDK and Xcode.

To be honest, the hardest things to learn are the capabilities of the frameworks themselves, NOT the language syntax. But that is an issue you have to tackle either way as these IDEs/Languages still require you to grasp some of the conventions of Cocoa (and Cocoa Touch).

I don't say this as a Cocoa / Objective-C snob, but if you know C (which as a C# dev you do) there really isn't any barrier to entry.

In addition, you will have access to tons of tutorials and sample code that just won't be available for these fledgling translators/IDEs/languages.

Learning another programming language is rarely a bad thing, and as an experienced programmer, your time investment won't be as large as you think.

Corey Floyd
Using MonoTouch for iPhone development because you already are a .NET programmer, is equal to welding a wooden bookcase because you already are a welder. Sometimes learning a few carpenter-tricks is good, especially if you want to avoid fire.
PeyloW
Using MonoTouch to "weld a wooden bookcase" is like having a welder you already know to use, but that magically hammers, screws, and glues the bookcase together without your having to know about the details. You *can* dig in and figure out your new magic welder, but you don't have to. If your goal is to build or fix a bookcase, and if all you know is welding, then... hey - go for it. Some people want to learn all about the gear - some just want to build things. With MonoTouch, you can do both (MT has taught me *more* about Apple's tool stack - that's awesome). Try it before you knock it :)
Rory Blyth
To be clear, though, I think every MonoTouch dev can greatly benefit from learning Apple's stack. I just don't feel they *have* to. I know that having done iPhone dev work for a year made it far easier for me to grok MonoTouch. Won't pretend that's not the case. But, speaking of "learning a few carpenter-tricks" - wouldn't you say that learning MonoTouch is doing just that? There are times when one stack makes sense over the other - *I* like having that choice. But, back to the beginning: I *do* recommend MT devs spend a few days with Apple's stack - it's fun, helpful, and can't hurt.
Rory Blyth
I would say that learning .NET on a Windows box or for web development definitely falls under learning new carpenter tricks. A lot of quality products are built in VS (we're using one now!) But I would not say the same of MonoTouch. MonoTouch is an abstraction layer on top of Cocoa Touch, specifically created to lower the barrier to entry for .NET devs. It doesn't actually add any capabilities to the stack that weren't there before. I can't think of an advantage (but I could be wrong) that experienced Cocoa/iPhone devs would gain from specifically learning MonoTouch.
Corey Floyd
To piggy back, I don't have anything specific against MonoTouch. I would only say that square brackets and @ signs shouldn't scare you away from the language. It really is just C with very thin layer or OOP added.
Corey Floyd
+32  A: 

Like any which-tool-or-platform-or-language-or-framework-or-whatever question, it should really come down to what you want.

Forget all the if-you-want-to-develop-for-this-platform-then-you-have-to-pay-your-dues advice. If you're interested in learning Objective-C, Xcode, and associated Apple bits, then goferit. I did. It's been fun, but my interest was in developing iPhone apps. Learning a new language, framework, and IDE was just a bonus (I like this stuff). It was also necessary when I started.

I've been working with MonoTouch since it was released, and I love it. I prefer C# to Objective-C, and I like having access to the subset of the .Net (Mono) framework that MonoTouch provides. There are certain things that are simply easier to do with .Net than Cocoa (string manipulation, date manipulation, anything XML, etc.).

I also like not having to deal with reference-counting anymore. I was spoiled by years of not having to keep track of resources at that level. I don't mind having to clean up after myself, but I don't want to have to manually do something that every other modern dev platform I've used does for me automatically. Plus, even for seasoned Objective-C devs, reference-counting isn't a no-brainer. Scroll through OS X's console output sometime to see how many apps crash due to memory-management issues (I know - this can happen with basically any app, but it's far easier to make the mistakes that lead to this situation when you get overworked devs involved whose attention spans have been destroyed by twelve hours of if this and if that and else this and else that and blah blah blah).

I still use Objective-C/Xcode - I've really learned to like Apple's tools. I honestly feel they're awkward and a bit arcane, but still fun.

But... then I also like this:

public string SomeString { get; set; }

To do the same thing with Objective-C (on the iPhone, anyway) requires that you declare a local variable to back the property, write the property declaration, and then use the "synthesize" directive to have the property generated for you (depending on what property attributes you specify, you might have a property that wraps getters and setters that take care of reference-counting for you - overall, this is a time-saver, but the C# Way is the clear winner here).

That's just one example of how MonoTouch can make your life easier, especially if you're used to .Net/Java/Python/other languages that don't require that you get your fingers dirty with memory-mangement (unless you want to).

As far as iPhone-ness is concerned, aside from brining part of .Net to the iPhone world, the MonoTouch namespace maps to CocoaTouch, so if you're confused about, say, the MonoTouch UIViewController, you can just hop over to Apple's docs on the UIViewController. MonoTouch .Net-izes CocoaTouch, but it's close enough that you're unlikely to hit a wall (that wouldn't have also hit if you were using Xcode/Objective-C). It's slick.

Titanium is different. Since they're trying (trying) to create an abstraction layer that lets you write the same app for multiple platforms, you're going to deal with the usual drawbacks: Totally different APIs, loss of flexibility (the same could be said of MonoTouch, but not remotely to the same degree), and basically having to learn a whole new platform (which is what you're trying to avoid by getting around Xcode/Objective-C/CocoaTouch, right?).

I also hate JavaScript, so I'm going to be biased against Titanium. But even if that weren't the case - even if I could use a language I do like - the APIs don't tickle my fancy. Or my anything.

Regardless of the dev tools you choose, you will end up having to learn something about CocoaTouch. Whether it's Xcode/Objective-C, MonoTouch, or Titanium, something is going to break or go all wonky on you, and you're eventually going to have to refer to CocoaTouch documentation.

If I were giving a talk on iPhone development (which I have, and which I will be doing again), and if I were to discuss alternatives to Apple's dev tools (which I will), I would still strongly encourage devs to at least work through a few basic iPhone apps using the native tools. It's going to make you a better developer for the platform - period. And you can use this beginning phase to determine if you even want to use anything other than the free Apple-supplied bits. You might not. I've been using MonoTouch because it pleases me - not because it's necessary.

So, to summarize a few basic criteria:

  • Preference (language/frameworks)

  • Devices (do you care about non-iPhone platforms or think you might someday?)

  • Comfort (if you like and know C# MUCH better than Objective-C, there's no reason not to go with MonoTouch)

And don't listen to the naysayers unless they've actually used the tech they're talking about. For example, I've read about Titanium, but I'm not experienced with it - I just know that I don't want anything to do with it on account of my preferences. That doesn't make it "bad" - just something I don't want in my life.

The Objective-C crowd can be impressively zealous. While there are plenty of open-minded devs in it, there are so, so, so many who think Objective-C and Cocoa and blah blah blah are THE last dev tools devkind will ever need.

Ignore them.

If you're worried about support, here's some stuff to consider:

  • Apple is likely to remain current, as they're the ones making this junk.

  • MonoTouch is likely to remain current - the Mono peeps have done an amazing job keep up with Microsoft, and I see no reason why they won't do the same with Apple. I'm blown away by what they do. And despite MonoTouch having been released, like, five minutes ago, they already have an update out for iPhone 3.1 stuff. They're serious about this, and I think they're magic. They're the Keebler Elves of the dev world. They sit in their secret layers and crank out stuff everybody (ok - not everybody) likes, but that nobody else would even attempt to do.

  • Titanium is either going to become an awkward unified API for writing apps for multiple platforms that is entirely its own thing, or it's going to become more and more splintered as the capabilities of different platforms diverge. Yeah, that's a bunch of typical armchair nerdly future-gazing... I should have prefaced this bullet item with "It's my opinion that..." If only there were a way to go back and change it.

I'll shut up now.

Go with what you like. MonoTouch is a "safe" alternative to Apple's stuff. I'm afraid Titanium is going to go down the same old oops-this-super-high-level-platform-abstraction-layer-stuff-doesn't-really-work road that so many other technologies have. But if you're doing something simple, there's no harm in giving it a shot, especially considering that it's free during the beta period.

Aright.

Really shutting up now... I hope this helps.

Rory Blyth
Rory, thanks for this clear and deep explanation that really gave shape to the various possible choices.
Ronnie
God damn that is a very helpful answer. Thanks for sharing what you know.
Yar
A: 

@Rory It would be great to hear you again on .NET Rocks, Rory. The episode where you shared your thoughts on iPhone development was very informative and enjoyable. It was also when you first found out you can write C# apps that target the iPhone.

blackjack2150
Please don't use answers to make comments. You should wait until you have earned the privilege of making comments.
Casebash
+1  A: 

I kinda like the idea of providing means to quickly get a grip on iPhone dev with techno people already know. I personnaly, as a Java developer, use iSPectrum (http://www.flexycore.com). It also come with an IDE, debugger and stuff, which make it really convenient to develop with because it benefits of all the power of Eclipse Java plugin. Being based on Java, this also allows to easily reuse already existing code from other java apps, which can be really handy providing that Java is present on almost all platforms (desktop & mobile alike) except iPhone. Plus it's free for open source projects.

I'd rather consider these kind of solutions, because I don't like the idea of coming back to developing in emacs :) .

Butters
+3  A: 

I know this is an old topic, but in the interest of staying current, it looks like MonoTouch and other cross-platform frameworks are going to be banned in SDK 4.0. Your only "safe" bet for writing iPhone apps is to use XCode and Objective-C, at least for the time being.

eman
A: 

Wow, old thread. To jump in, there are numerous ways to get on the device. Having said that, Apple has stated in the SDK license that the only approved way to get on the device is via C, C++, ObjectiveC, and Javascript.

It appears at this point in time that apps built on MonoTouch and Appcelerator Titanium are being accepted into the App Store. Thanks to the license change, there is much FUD on this subject. Apple has scared everyone not doing ObjectiveC.

I would suggest that you do whatever makes the most sense for you as a developer. If you know C# and .NET, you should go with MonoTouch. If you know ObjectiveC or the Mac platform, ObjectiveC is probably the way to go. If you know X and its on the iPhone, well, X is where I would suggest looking first.

A: 

If you're C# programmer why you shouldn't invest some times to learn Objective C. Honestly speaking, it will not take much time from you. But you feels good to work in a new platform with new language. Learning new things all time fascinates me.

Mahmud Ahsan