7

Should I use Mono + c#? Or I'm better off learning and using objective c? Thanks

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
Nestor
  • 13,706
  • 11
  • 78
  • 119

7 Answers7

24

This will probably offend some but to be honest, if you are going to do any serious development, you should learn Objective-C. Not knowing Objective-C in iPhone development will just be a hindrance. You won't be able to understand many examples; you have to deal with the quirks of Mono whereas if you had a working knowledge of Objective-C you could get a lot more out of the platform documentation.

Personally, I don't understand the position that says increasing the amount of information you need in favor of using Mono over the platform's native language. It seems somewhat counterproductive to me. I think if this is a very expensive proposition (learning a new language) then it may be worthwhile spending some time on fundamental programming concepts so that learning new languages is a fairly cheap proposition.

BobbyShaftoe
  • 28,337
  • 7
  • 52
  • 74
  • Your reasoning makes perfect sense to me.Thanks – Nestor Oct 01 '09 at 20:02
  • And to add insult to injury; MonoTouch do not even have proper debugging support. So you will have to learn all these new things with only log-prints to guide you. Since when did a beginner spend more time writing new code than debugging? – PeyloW Oct 02 '09 at 09:01
9

Have a look at MonoTouch.

nitzmahone
  • 13,720
  • 2
  • 36
  • 39
  • I wonder what Apple has to say about MonoTouch. Know of any possible issues in future? – Brian Kim Oct 01 '09 at 19:52
  • 1
    MonoTouch is okay because it's not using an interpreter like some other languages on the iPhone. It gets compiled to native Objective-C code, so in the end, the two are indistinguishable. However, you are at the mercy of Novell's support of MonoTouch, instead of Apple's direct support. – Will Eddins Oct 01 '09 at 19:55
7

Monotouch is easier for you now. But harder later.

For example, what happens when new seeds come out you need to test against but break MonoTouch for some reason?

By sticking with Mono, any time you are looking up resources for frameworks you have to translate mentally into how you are going to use them with Mono. Your app binaries will be larger, your development time not that much faster after a few months into Objective-C, and other app developers will have that much more of an advantage over you because they are using the native platform.

Another consideration is that you are looking to use C# because you are more familiar with the language than Objective-C. But the vast majority of the learning curve for the iPhone is not Objective-C, it is the frameworks - which you will have to call into with C# as well.

For any platform, you should use the platform that directly expresses the design philosophy of that platform - on the iPhone, that is Objective-C. Think about this from the reverse angle, if a Linux developer used to programming in GTK wanted to write Windows apps would you seriously recommend that they not use C# and stick to GTK because it was "easier" for them to do so?

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
3

If you want to be able to use all of the APIs of the iPhone and have access to native code debugging, you probably are going to want to learn Objective C.

There is, however, Mono-Touch which for a small price lets you develop iPhone apps using C# but lacks debugging support currently. There are also limitations on certain uses of generics and other high-end features. Here's a link to the limitations.

Also, to use Mono-Touch you still need Xcode and a Mac environment set up to develop for iPhone. And it goes without saying you need to join the Apple iPhone developer program if you're actually going to want to deploy anything to an actual device.

LBushkin
  • 129,300
  • 32
  • 216
  • 265
  • Understood. Is there an IDE to develop in Objective C for Windows by any chance? (something similar to Visual Studio) – Nestor Oct 01 '09 at 19:53
  • Apple makes XCode freely available - but it only runs on Macs. – LBushkin Oct 01 '09 at 19:57
  • I believe that is on purpose as well. If you want to develop for the iPhone, Apple wants you to buy a Mac. If you look at the download page for MonoTouch, even if you want to use C#, it requires you have a Mac. – Will Eddins Oct 01 '09 at 20:04
  • Oh shoot... I didnt know that I needed a Mac, even for MonoTouch. I'm in trouble then. – Nestor Oct 01 '09 at 20:06
  • In exploration of this same question set for my use, is there a virtual machine or some such for any Windows OS that emulates a MAC that you could use for development? – Mark Schultheiss Oct 01 '09 at 20:15
1

This is going to be a bit of an opinion question but my take is that you're better off sticking with C#. Switching to objective-C is increasing the amount of new information you must learn before you can be productive in your environment.

Even keeping with C# you'll still have to ...

  • Learn the iPhone API
  • Learn the quirks of developing with the iPhone itself

There are some downsides to using C# though

  • Most iPhone samples will be in Objective-C. Because you don't know the language it will be harder to apply them to your problem set
  • There are bound to be little quirks in using static compilation in Mono that you'll need to get used to.

My intuition though is these will be minor compared to the cost of learning a new language.

EDIT

I wanted to clarify my thoughts on learning a new language. I think learning languages is fun and a necessary part of a programmers life. You should be at least experimenting with a new language once every year. This year I'm toying with F#.

The only reason I recomended against it for this question was the OP said "the easiest way ...". Learning a new language does require extra time and will take a bit more effort so I qualified it as easier to stick with C#.

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • 2
    But on the other hand... its always fun to learn new things! But since the question asked for "easy", you're right. MonoTouch is likely the way to go, although more pricey at a $400 license and will likely have less community support with issues. – Will Eddins Oct 01 '09 at 19:53
  • It does take some getting used to. I've used C, C++, Java, and C#, yet I had trouble wrapping my mind around some of the concepts (and still wouldn't be comfortable in it). Although I had more issues with XCode and some of the designer quirks than the language itself. – Will Eddins Oct 01 '09 at 20:02
  • I've learned many languages in my professional life. I'm not scared of new syntax. Is there a new paradigme behind objective-c? Or it's a regular object oriented language? – Nestor Oct 01 '09 at 20:02
  • 1
    @Guard, @Nestor. See my clarification on why I recomended against learning a new language. I myself love learning new languages and think it's extremely important to do so as a programmer. – JaredPar Oct 01 '09 at 20:15
  • I have to strongly disagree. In order to use MonoTouch beyond writing _"Hello World"_ you must still learns; Cocoa Touch, the inner workings of Objective-C, and on top of that the inner workings of MonoTouch. So for any application beyond the most basic use cases you actually have to learn **allot** more to use MonoTouch, than just biting down and spend a few days learning Objective-C. – PeyloW Oct 02 '09 at 08:58
  • @Nestor: Objective-C is OOP, but not quite the regular kind you are used to from C++, Java and C#. Those are all strongly typed, whereas Objective-C is dynamically typed, and the Cocoa Touch frameworks takes full advantage of this, meaning you have to learn _"Dynamic OOP"_. Objective-C is more related to Ruby in a way. – PeyloW Oct 02 '09 at 09:04
0

MonoTouch I think is the way to go but keep in mind it's still in it's infancy. I was able to install the Mono development tools and get the MonoDevelop IDE working but the IDE in it's current state is incredibly slow and almost unusable; at least running on Snow Leopard for Mac OSX. I did some googling and it looks to be that this is a known issue but is fixed in the bleeding edge repositories of MonoDevelop. I think Novell is on to something but I also feel that you will be wrestling with the entire framework while it's still in the early stages.

So bottom line, if you want to go to the C#/MonoTouch route, be prepared to put in a lot leg work, and ghost chasing because of instabilities or incompleteness of the framework. I think this is true for any new framework.

Ralph Caraveo
  • 10,025
  • 7
  • 40
  • 52
0

I found this interesting Podcast

Nestor
  • 13,706
  • 11
  • 78
  • 119