c# iPhone development vs objective c iPhone development [closed]
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... :)
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.
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.
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.
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.
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.
Go native or don't bother. Apple supports Objective-C, and does not support C#.
精彩评论