4

Which language is better for iPhone application development? Normally objective c using for iPhone application development. But monotouch supports iPhone development with c#.

Before that I didn't use c# and objective c for any application development. So im totally new to both languages. Give me suggestion for iPhone application development... :)

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
bharath
  • 14,283
  • 16
  • 57
  • 95
  • 1
    What languages have you used before? You should look up some code examples and see what language you feel most comfortable with. Objective-C is a lot like Apple Talk, sending "messages" between functions. If you've used java or something like that before, I'd go for C# Here's an link to another thread for one who was used to c# http://stackoverflow.com/questions/2696518/monotouch-c-vs-objective-c-for-iphone-app – NoLifeKing Feb 04 '11 at 10:24
  • Before I developed j2me, blackberry and android based application. – bharath Feb 04 '11 at 10:34
  • 1
    Here is a link to someone who took the time to make a comparison of Java and C# http://www.25hoursaday.com/CsharpVsJava.html As you used j2me before, I would check for some C# examples, sure there are not a lot of tutorials as the other answers say, but if you ask the people at the monotouch forum they'd probably give you a good answer. – NoLifeKing Feb 04 '11 at 10:36

6 Answers6

5

Here is my personal opinion:

I've been in the .NET world for a while. When iPhone launched the ability to create native apps, it called my attention. I really tried to learn Objective-C. I read 2 books and started trying and trying and trying for like a month and then I left iPhone programming due to the fact that you had to make tons of things that on .NET required one line of code.

When Miguel de Icaza launched MonoTouch, I gave it a try, and I realized that most of my previously done code was fully functional. I've always tried to separate UI code from business code, and this is really the point of .NET on the iPhone - To bring most of your already-done business logic to the device.

Also on Objective-C, you wont find anything like LINQ or the var keyword. Consuming web services on MonoTouch is just a few clicks away.

If you want to target the Android platform, there is also MonoDroid (monodroid.net). Also if you want to target Mac OSX there is MonoMac. So you can share class libs between these 3 platforms without much hassle. Not to mention, it will work on Windows too and vice-versa (when possible).

The only thing you will need to worry about is the UI, but most of your business logic should work.

Here is a complete list of .NET Assemblies supported in MonoTouch: http://monotouch.net/Documentation/Assemblies. Also, MonoTouch exposes a C#/CIL binding to all the CocoaTouch APIs.

Also the support of the MonoTouch team is awesome. You can just get on IRC, ask a question, and it will be answered right away. They have a mailing list too. :)

I really enjoy MonoTouch. I know that no language is perfect for all tasks, and Objective-C is no exception.

Jim G.
  • 15,141
  • 22
  • 103
  • 166
dalexsoto
  • 3,412
  • 1
  • 27
  • 43
4

If you use c# with monotouch there is far less documentation than Objective-C, simply because the majority of iPhone apps are developed with Obj-C rather than c#. If you are new to both languages I would advise Obj-C because of the massive amount of online tutorials, sample code and documentation from Apple and peoples' blogs. There are also far more books available to buy for Obj-C iPhone development.

Though you also have to decide if you think that c# might be easier to learn than Obj-C, and if that would be enough to go without the huge amount of samples.

At the end of the day it's simply which you prefer.

Alex Stuckey
  • 1,250
  • 1
  • 14
  • 28
3

Depends on what your wants/needs are. Being completely new to this you might find jumping straight into Objective C the better solution.

However, this question is quite open there is no real answer to it, try both and see which you are most comfortable with.

Lloyd
  • 29,197
  • 4
  • 84
  • 98
1

If you have never used either languages I would advise to use Apples XCode and learn Objective C since this is the supported language from Apple. Also the cost will be lower.

Richard
  • 21,728
  • 13
  • 62
  • 101
1

Since you didn't use C# or Objective-C before, I'd recommend to go native. In that case following the majority of iOS developers is actually a good idea:

  • Apple documentation is really good (IMO better than Android's) and you can even take online classes (google for CS193 - Stanford's iPhone Application Development classes);
  • there are plenty of good books on Objective-C (Kochan's classic "Programming in Objective-C" to name one) and on iPhone development (all books I know use Objective-C);
  • iOS development has a big community willing to share knowledge (like here at StackOverflow), so you're learning curve may be tough in the beginning but you'll learn useful stuff faster than trying to solve some issues with C# (that's my assumption);

Please note: I never tried monotouch/C# combination, but I still believe going native with Obj-C is a wiser choice.

matm
  • 7,059
  • 5
  • 36
  • 50
-3

Go native or don't bother. Apple supports Objective-C, and does not support C#.

NSResponder
  • 16,861
  • 7
  • 32
  • 46