Live data from Hacker News

MonoTouch for iPhone - C# bindings for native APIs

monotouch.net

1–10 of 23 posts

Re: MonoTouch for iPhone - C# bindings for native APIs

#2
It looks like you have to develop in MonoDevelop to use this, which is a bit of a shame. After all, the reason most teams use C# in the first place is that you get to use the best IDE around. Outside the context of VS.NET, C# doesn't have nearly as much going for it.

Still, if it lets me avoid Objective C, I think I'll give this a shot.

Re: MonoTouch for iPhone - C# bindings for native APIs

#3

It looks like you have to develop in MonoDevelop to use this, which is a bit of a shame. After all, the reason most teams use C# in the first place is that you get to use the best IDE around. Outside the context of VS.NET, C# doesn't have nearly as much going for it. Still, if it lets me avoid Objective C, I think I'll give this a shot.

You can use C# with XCode: http://code.google.com/p/cocoa-sharp-dev/wiki/CSharpPlugin

MonoTouch's site has a tutorial on how to use XCode + Monotouch: http://monotouch.net/Documentation/XCode

Re: MonoTouch for iPhone - C# bindings for native APIs

#4

It looks like you have to develop in MonoDevelop to use this, which is a bit of a shame. After all, the reason most teams use C# in the first place is that you get to use the best IDE around. Outside the context of VS.NET, C# doesn't have nearly as much going for it. Still, if it lets me avoid Objective C, I think I'll give this a shot.

Consider toying around with Objective-C. I was pleasantly surprised. I had never used SmallTalk, and I had a good time with the idea of "message passing". This doesn't take away the requirement of having to own a Mac, so it's free to try it out anyway.

If you have already tried it out and hate it, then I'm glad there is a new option!

Re: MonoTouch for iPhone - C# bindings for native APIs

#5
This gets my vote simply because I won't be forced to use an otherwise unmarketable language like Objective C. Not that I hate the syntax...it's not that bad really...but I hate that I'm forced to learn it just for iPhone or OS X development. I can't really use it elsewhere. With Mono/C# that's not the case, and it's immediately worth it. I hope they'll target other phones and make it at least possible to migrate your app from one to the other, but a quick glance at the tutorials makes me suspect this is very bound to the iPhone.

I'm also more than a little concerned that you have to pay for the dev environment itself (with an evaluation version on the way). I really hate this model. They should've gone the route of giving away to tools themselves for free, but charging upon the need to deploy. This allows developers like me to vet the platform before spending hard-earned dollars.

Re: MonoTouch for iPhone - C# bindings for native APIs

#6
post #5

This gets my vote simply because I won't be forced to use an otherwise unmarketable language like Objective C. Not that I hate the syntax...it's not that bad really...but I hate that I'm forced to learn it just for iPhone or OS X development. I can't really use it elsewhere. With Mono/C# that's not the case, and it's immediately worth it. I hope they'll target other phones and make it at least possible to migrate you…

> This gets my vote simply because I won't be forced to use an otherwise unmarketable language like Objective C

I don't understand this argument. If you're already familiar with object oriented programming, it should only take you a day or two to learn Objective-C. This won't save you from having to learn Cocoa Touch, which is where the real time investment is.

Re: MonoTouch for iPhone - C# bindings for native APIs

#7

It looks like you have to develop in MonoDevelop to use this, which is a bit of a shame. After all, the reason most teams use C# in the first place is that you get to use the best IDE around. Outside the context of VS.NET, C# doesn't have nearly as much going for it. Still, if it lets me avoid Objective C, I think I'll give this a shot.

You can use C# with XCode: http://code.google.com/p/cocoa-sharp-dev/wiki/CSharpPlugin MonoTouch's site has a tutorial on how to use XCode + Monotouch: http://monotouch.net/Documentation/XCode

Additionally, FWIW, the entire GUI is done with Interface builder rather than MonoDevelop.

MonoDevelop fires up interface builder, and then quietly rebuilds the backing code when you're done editing. So they haven't completely reinvented the wheel, it is using standard NIB files.

Re: MonoTouch for iPhone - C# bindings for native APIs

#8
post #6
post #5

This gets my vote simply because I won't be forced to use an otherwise unmarketable language like Objective C. Not that I hate the syntax...it's not that bad really...but I hate that I'm forced to learn it just for iPhone or OS X development. I can't really use it elsewhere. With Mono/C# that's not the case, and it's immediately worth it. I hope they'll target other phones and make it at least possible to migrate you…

> This gets my vote simply because I won't be forced to use an otherwise unmarketable language like Objective C I don't understand this argument. If you're already familiar with object oriented programming, it should only take you a day or two to learn Objective-C. This won't save you from having to learn Cocoa Touch, which is where the real time investment is.

>> it should only take you a day or two to learn Objective-C

It's the libraries! Takes a long time to learn them all...

Re: MonoTouch for iPhone - C# bindings for native APIs

#9
post #4

It looks like you have to develop in MonoDevelop to use this, which is a bit of a shame. After all, the reason most teams use C# in the first place is that you get to use the best IDE around. Outside the context of VS.NET, C# doesn't have nearly as much going for it. Still, if it lets me avoid Objective C, I think I'll give this a shot.

Consider toying around with Objective-C. I was pleasantly surprised. I had never used SmallTalk, and I had a good time with the idea of "message passing". This doesn't take away the requirement of having to own a Mac, so it's free to try it out anyway. If you have already tried it out and hate it, then I'm glad there is a new option!

I've been doing Objective-C for a long time, and I can barely stand the language. I use it because it's the most pragmatic choice for Mac (and now iPhone) development, but if I could I'd have dropped it in a heartbeat. It's incredibly verbose and almost the antithesis of "don't repeat yourself" -- as an arbitrary example, declaring an Objective-C 2.0 properties requires three different declarations:

1) Declare the instance variable in your header file: NSString * var;

2) Declare the property that matches the ivar in your header file: @property(nonatomic, retain) NSString * var;

3) Add the synthesize line to your implementation file: @synthesize var;

I mean, seriously Apple? Seriously? You couldn't compress that down to a single @property declaration?

That said, Apple has now added closures, which provides a highly effective tool for cutting through the usually highly repetitive, verbose code of Obj-C (except, perhaps, for property declarations :) and writing something a quite bit more palatable.

My only remaining complaint is the lack of GC. It's not that I mind reference counting (it's not very hard to get it right), but that cyclic references cause leaks, and there's lots of places where it's easy and beneficial to create cyclic references -- especially with closures.

If MonoTouch means I can write well-performing native applications for the iPhone in F#, god damn! I'm there.

Re: MonoTouch for iPhone - C# bindings for native APIs

#10
post #8
post #6

Earlier quoted context omitted.

> This gets my vote simply because I won't be forced to use an otherwise unmarketable language like Objective C I don't understand this argument. If you're already familiar with object oriented programming, it should only take you a day or two to learn Objective-C. This won't save you from having to learn Cocoa Touch, which is where the real time investment is.

>> it should only take you a day or two to learn Objective-C It's the libraries! Takes a long time to learn them all...

Except even MonoTouch presumably just has .NET bindings for UIKit, in much the same way there is Cocoa# for writing GUI mac apps with Mono. The difference here is mainly AOT compilation for ARM plus some different system bindings and maybe an optimised memory footprint.

The GUI library issue is the same on all platforms really. No matter what language you're using, the interface is going to be a wrapper for the underlying System API, which is either a C, C++, or Objective-C library.

Post reply on HN